Package org.xipki.ca.server
Class FileCaConfStore
- java.lang.Object
-
- org.xipki.ca.server.FileCaConfStore
-
- All Implemented Interfaces:
CaConfStore
public class FileCaConfStore extends Object implements CaConfStore
This class represents the file-based CA configuration.- Author:
- Lijun Liao (xipki)
-
-
Constructor Summary
Constructors Constructor Description FileCaConfStore(org.xipki.security.SecurityFactory securityFactory, CertprofileFactoryRegister certprofileFactoryRegister, List<String> confFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCa(org.xipki.ca.api.mgmt.entry.CaEntry caEntry)voidaddCaAlias(String aliasName, org.xipki.ca.api.NameId ca)voidaddCertprofile(org.xipki.ca.api.mgmt.entry.CertprofileEntry dbEntry)voidaddCertprofileToCa(org.xipki.ca.api.NameId profile, org.xipki.ca.api.NameId ca, List<String> aliases)voidaddDbSchema(String name, String value)org.xipki.ca.api.NameIdaddEmbeddedRequestor(String requestorName)voidaddKeypairGen(org.xipki.ca.api.mgmt.entry.KeypairGenEntry dbEntry)voidaddPublisher(org.xipki.ca.api.mgmt.entry.PublisherEntry dbEntry)voidaddPublisherToCa(org.xipki.ca.api.NameId publisher, org.xipki.ca.api.NameId ca)voidaddRequestor(org.xipki.ca.api.mgmt.entry.RequestorEntry dbEntry)voidaddRequestorToCa(org.xipki.ca.api.mgmt.entry.CaHasRequestorEntry requestor, org.xipki.ca.api.NameId ca)voidaddSigner(org.xipki.ca.api.mgmt.entry.SignerEntry dbEntry)voidchangeCa(org.xipki.ca.api.mgmt.entry.ChangeCaEntry changeCaEntry, org.xipki.ca.api.mgmt.entry.CaConfColumn currentCaConfColumn, org.xipki.security.SecurityFactory securityFactory)IdentifiedCertprofilechangeCertprofile(org.xipki.ca.api.NameId nameId, String type, String conf, CaManagerImpl certprofileManager)voidchangeDbSchema(String name, String value)KeypairGenEntryWrapperchangeKeypairGen(String name, String type, String conf, CaManagerImpl manager)IdentifiedCertPublisherchangePublisher(String name, String type, String conf, CaManagerImpl publisherManager)RequestorEntryWrapperchangeRequestor(org.xipki.ca.api.NameId nameId, String type, String conf)org.xipki.ca.api.mgmt.entry.SignerEntrychangeSigner(String name, String type, String conf, String base64Cert, CaManagerImpl signerManager)voidchangeSystemEvent(SystemEvent systemEvent)voidcommitNextCrlNoIfLess(org.xipki.ca.api.NameId ca, long nextCrlNo)Map<String,Integer>createCaAliases()Set<CaProfileIdAliases>createCaHasProfiles(org.xipki.ca.api.NameId ca)Set<Integer>createCaHasPublishers(org.xipki.ca.api.NameId ca)Set<org.xipki.ca.api.mgmt.entry.CaHasRequestorEntry>createCaHasRequestors(org.xipki.ca.api.NameId ca)CaInfocreateCaInfo(String name, CertStore certstore)org.xipki.ca.api.mgmt.entry.CertprofileEntrycreateCertprofile(String name)org.xipki.ca.api.mgmt.entry.KeypairGenEntrycreateKeypairGen(String name)org.xipki.ca.api.mgmt.entry.PublisherEntrycreatePublisher(String name)org.xipki.ca.api.mgmt.entry.RequestorEntrycreateRequestor(String name)org.xipki.ca.api.mgmt.entry.SignerEntrycreateSigner(String name)booleandeleteCa(String name)booleandeleteKeyPairGen(String name)booleandeleteProfile(String name)booleandeletePublisher(String name)booleandeleteRequestor(String name)booleandeleteSigner(String name)List<String>getCaNames()Map<String,String>getDbSchemas()intgetDbSchemaVersion()List<String>getKeyPairGenNames()List<String>getProfileNames()List<String>getPublisherNames()IntegergetRequestorId(String requestorName)List<String>getRequestorNames()List<String>getSignerNames()SystemEventgetSystemEvent(String eventName)Retrieve the system event.booleanneedsCertStore()voidremoveCaAlias(String aliasName)voidremoveCertprofileFromCa(String profileName, String caName)voidremoveDbSchema(String name)voidremovePublisherFromCa(String publisherName, String caName)voidremoveRequestorFromCa(String requestorName, String caName)voidrevokeCa(String caName, org.xipki.security.CertRevocationInfo revocationInfo)voidunlockCa()voidunrevokeCa(String caName)
-
-
-
Constructor Detail
-
FileCaConfStore
public FileCaConfStore(org.xipki.security.SecurityFactory securityFactory, CertprofileFactoryRegister certprofileFactoryRegister, List<String> confFiles) throws IOException, org.xipki.ca.api.mgmt.CaMgmtException, org.xipki.util.exception.InvalidConfException- Throws:
IOExceptionorg.xipki.ca.api.mgmt.CaMgmtExceptionorg.xipki.util.exception.InvalidConfException
-
-
Method Detail
-
needsCertStore
public boolean needsCertStore()
- Specified by:
needsCertStorein interfaceCaConfStore
-
getSystemEvent
public SystemEvent getSystemEvent(String eventName) throws org.xipki.ca.api.mgmt.CaMgmtException
Description copied from interface:CaConfStoreRetrieve the system event.- Specified by:
getSystemEventin interfaceCaConfStore- Parameters:
eventName- Event name- Returns:
- the System event, may be
null. - Throws:
org.xipki.ca.api.mgmt.CaMgmtException- If error occurs.
-
changeSystemEvent
public void changeSystemEvent(SystemEvent systemEvent) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeSystemEventin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCaAliases
public Map<String,Integer> createCaAliases() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCaAliasesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCertprofile
public org.xipki.ca.api.mgmt.entry.CertprofileEntry createCertprofile(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCertprofilein interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createPublisher
public org.xipki.ca.api.mgmt.entry.PublisherEntry createPublisher(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createPublisherin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getRequestorId
public Integer getRequestorId(String requestorName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getRequestorIdin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createRequestor
public org.xipki.ca.api.mgmt.entry.RequestorEntry createRequestor(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createRequestorin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createSigner
public org.xipki.ca.api.mgmt.entry.SignerEntry createSigner(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createSignerin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createKeypairGen
public org.xipki.ca.api.mgmt.entry.KeypairGenEntry createKeypairGen(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createKeypairGenin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCaInfo
public CaInfo createCaInfo(String name, CertStore certstore) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCaInfoin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCaHasRequestors
public Set<org.xipki.ca.api.mgmt.entry.CaHasRequestorEntry> createCaHasRequestors(org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCaHasRequestorsin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCaHasProfiles
public Set<CaProfileIdAliases> createCaHasProfiles(org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCaHasProfilesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
createCaHasPublishers
public Set<Integer> createCaHasPublishers(org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
createCaHasPublishersin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addCa
public void addCa(org.xipki.ca.api.mgmt.entry.CaEntry caEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addCaAlias
public void addCaAlias(String aliasName, org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
addCaAliasin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addCertprofile
public void addCertprofile(org.xipki.ca.api.mgmt.entry.CertprofileEntry dbEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addCertprofilein interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addCertprofileToCa
public void addCertprofileToCa(org.xipki.ca.api.NameId profile, org.xipki.ca.api.NameId ca, List<String> aliases) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addCertprofileToCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addPublisherToCa
public void addPublisherToCa(org.xipki.ca.api.NameId publisher, org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addPublisherToCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addRequestor
public void addRequestor(org.xipki.ca.api.mgmt.entry.RequestorEntry dbEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addRequestorin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addEmbeddedRequestor
public org.xipki.ca.api.NameId addEmbeddedRequestor(String requestorName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
addEmbeddedRequestorin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addRequestorToCa
public void addRequestorToCa(org.xipki.ca.api.mgmt.entry.CaHasRequestorEntry requestor, org.xipki.ca.api.NameId ca) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addRequestorToCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addPublisher
public void addPublisher(org.xipki.ca.api.mgmt.entry.PublisherEntry dbEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addPublisherin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeCa
public void changeCa(org.xipki.ca.api.mgmt.entry.ChangeCaEntry changeCaEntry, org.xipki.ca.api.mgmt.entry.CaConfColumn currentCaConfColumn, org.xipki.security.SecurityFactory securityFactory) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
changeCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
commitNextCrlNoIfLess
public void commitNextCrlNoIfLess(org.xipki.ca.api.NameId ca, long nextCrlNo) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
commitNextCrlNoIfLessin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeCertprofile
public IdentifiedCertprofile changeCertprofile(org.xipki.ca.api.NameId nameId, String type, String conf, CaManagerImpl certprofileManager) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeCertprofilein interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeRequestor
public RequestorEntryWrapper changeRequestor(org.xipki.ca.api.NameId nameId, String type, String conf) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeRequestorin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeSigner
public org.xipki.ca.api.mgmt.entry.SignerEntry changeSigner(String name, String type, String conf, String base64Cert, CaManagerImpl signerManager) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeSignerin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeKeypairGen
public KeypairGenEntryWrapper changeKeypairGen(String name, String type, String conf, CaManagerImpl manager) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeKeypairGenin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changePublisher
public IdentifiedCertPublisher changePublisher(String name, String type, String conf, CaManagerImpl publisherManager) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changePublisherin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
removeCaAlias
public void removeCaAlias(String aliasName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
removeCaAliasin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
removeCertprofileFromCa
public void removeCertprofileFromCa(String profileName, String caName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
removeCertprofileFromCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
removeRequestorFromCa
public void removeRequestorFromCa(String requestorName, String caName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
removeRequestorFromCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
removePublisherFromCa
public void removePublisherFromCa(String publisherName, String caName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
removePublisherFromCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
removeDbSchema
public void removeDbSchema(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
removeDbSchemain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
revokeCa
public void revokeCa(String caName, org.xipki.security.CertRevocationInfo revocationInfo) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
revokeCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addKeypairGen
public void addKeypairGen(org.xipki.ca.api.mgmt.entry.KeypairGenEntry dbEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addKeypairGenin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
addSigner
public void addSigner(org.xipki.ca.api.mgmt.entry.SignerEntry dbEntry) throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
addSignerin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
unlockCa
public void unlockCa() throws org.xipki.ca.api.mgmt.CaMgmtException- Specified by:
unlockCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
unrevokeCa
public void unrevokeCa(String caName) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
unrevokeCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getDbSchemaVersion
public int getDbSchemaVersion()
- Specified by:
getDbSchemaVersionin interfaceCaConfStore
-
addDbSchema
public void addDbSchema(String name, String value) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
addDbSchemain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
changeDbSchema
public void changeDbSchema(String name, String value) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
changeDbSchemain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getDbSchemas
public Map<String,String> getDbSchemas() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getDbSchemasin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getCaNames
public List<String> getCaNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getCaNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deleteCa
public boolean deleteCa(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deleteCain interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getKeyPairGenNames
public List<String> getKeyPairGenNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getKeyPairGenNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deleteKeyPairGen
public boolean deleteKeyPairGen(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deleteKeyPairGenin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getProfileNames
public List<String> getProfileNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getProfileNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deleteProfile
public boolean deleteProfile(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deleteProfilein interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getPublisherNames
public List<String> getPublisherNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getPublisherNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deletePublisher
public boolean deletePublisher(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deletePublisherin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getRequestorNames
public List<String> getRequestorNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getRequestorNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deleteRequestor
public boolean deleteRequestor(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deleteRequestorin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
getSignerNames
public List<String> getSignerNames() throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
getSignerNamesin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
deleteSigner
public boolean deleteSigner(String name) throws org.xipki.ca.api.mgmt.CaMgmtException
- Specified by:
deleteSignerin interfaceCaConfStore- Throws:
org.xipki.ca.api.mgmt.CaMgmtException
-
-