Package org.xipki.ca.api.mgmt
Interface CaManager
-
public interface CaManagerInterface to manage the CA system.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_SERIALNUMBER_SIZESince serial number should be positive and maximal 20 bytes.static intMIN_SERIALNUMBER_SIZEAlthough it is possible to configure it to 1, it is recommended to set it to at least 9.static StringNULL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCa(CaEntry caEntry)Adds a CA.voidaddCaAlias(String aliasName, String caName)Adds the aliasaliasNameto the given CAcaName.voidaddCertprofile(CertprofileEntry certprofileEntry)Adds a certificate profile.voidaddCertprofileToCa(String profileName, String caName)Add the certificate profileprofileNamethe CAcaName.voidaddDbSchema(String name, String value)voidaddKeypairGen(KeypairGenEntry keypairGenEntry)Adds a keypair generation entry.voidaddPublisher(PublisherEntry entry)Adds a publisher.voidaddPublisherToCa(String publisherName, String caName)Adds publisherpublisherNameto CAcaName.voidaddRequestor(RequestorEntry requestorEntry)Adds requstor.voidaddRequestorToCa(CaHasRequestorEntry requestor, String caName)Adds the requestorrequestorNameto the CAcaName.voidaddSigner(SignerEntry signerEntry)Adds a signer.voidchangeCa(ChangeCaEntry changeCaEntry)Changes a CA.voidchangeCertprofile(String name, String type, String conf)Changes the certificate profilename.voidchangeDbSchema(String name, String value)voidchangeKeypairGen(String name, String type, String conf)Changes the keypair generation entryname.voidchangePublisher(String name, String type, String conf)Changes the publishername.voidchangeRequestor(String name, String type, String conf)Changes the requestornameof type CERTIFCATE.voidchangeSigner(String name, String type, String conf, String base64Cert)Changes the signername.voidclearPublishQueue(String caName, List<String> publisherNames)Clear the publishing queue for the CAcaNameand publisherspublisherNames.InputStreamexportConf(List<String> caNames)Exports the CA system configuration to a zip-stream.org.xipki.security.X509CertgenerateCertificate(String caName, String profileName, byte[] encodedCsr, Instant notBefore, Instant notAfter)CAcaNameissues a new certificate.org.bouncycastle.cert.X509CRLHoldergenerateCrlOnDemand(String caName)Generates a new CRL for CAcaName.org.xipki.security.X509CertgenerateCrossCertificate(String caName, String profileName, byte[] encodedCsr, byte[] encodedTargetCert, Instant notBefore, Instant notAfter)CAcaNameissues a new certificate.org.xipki.security.KeyCertBytesPairgenerateKeyCert(String caName, String profileName, String subject, Instant notBefore, Instant notAfter)CAcaNameissues a new certificate.org.xipki.security.X509CertgenerateRootCa(CaEntry caEntry, String certprofileName, String subject, String serialNumber, Instant notBefore, Instant notAfter)Generates a self-signed CA certificate.Set<String>getAliasesForCa(String caName)Gets the aliases of the given CAcaName.CaEntrygetCa(String caName)Gets the CA namedcaName.Set<String>getCaAliasNames()StringgetCaNameForAlias(String aliasName)Gets the CA name for the aliasaliasName.Set<String>getCaNames()CaSystemStatusgetCaSystemStatus()CertWithRevocationInfogetCert(String caName, BigInteger serialNumber)Returns certificate with status information for the CAcaNameand with serial numberserialNumber.CertWithRevocationInfogetCert(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber)Returns certificate with revocation information for theissuerand with serial numberserialNumber.CertprofileEntrygetCertprofile(String profileName)Returns the certificate profile namedprofileName.Set<String>getCertprofileNames()Set<String>getCertprofilesForCa(String caName)Returns the Certprofile names supported by the CAcaName.org.bouncycastle.cert.X509CRLHoldergetCrl(String caName, BigInteger crlNumber)Returns the CRL of CAcaNamewith the CRL numbercrlNumber.org.bouncycastle.cert.X509CRLHoldergetCurrentCrl(String caName)Returns the latest CRL of CAcaName.Map<String,String>getDbSchemas()Set<String>getFailedCaNames()Set<String>getInactiveCaNames()KeypairGenEntrygetKeypairGen(String name)Returns the keypair generation entry namedprofileName.Set<String>getKeypairGenNames()PublisherEntrygetPublisher(String publisherName)Returns the publisher.Set<String>getPublisherNames()List<PublisherEntry>getPublishersForCa(String caName)Returns publishers for the CAcaName.RequestorEntrygetRequestor(String name)Returns the requestor namedname.Set<String>getRequestorNames()Set<CaHasRequestorEntry>getRequestorsForCa(String caName)Returns the Requests supported by the CAcaName.SignerEntrygetSigner(String name)Returns the signer namedname.Set<String>getSignerNames()Set<String>getSuccessfulCaNames()Set<String>getSupportedCertprofileTypes()Retrieves the types of supported certificate profiles.Set<String>getSupportedPublisherTypes()Retrieves the types of supported publishers.Set<String>getSupportedSignerTypes()Retrieves the types of supported signers.StringgetTokenInfoP11(String moduleName, Integer slotIndex, boolean verbose)List<CertListInfo>listCertificates(String caName, org.bouncycastle.asn1.x500.X500Name subjectPattern, Instant validFrom, Instant validTo, CertListOrderBy orderBy, int numEntries)Returns a sorted list of certificate meta information.Map<String,org.xipki.security.X509Cert>loadConf(InputStream zippedConfStream)Loads the CA system configuration.voidnotifyCaChange()voidremoveCa(String caName)Removes the CAcaNamefrom the system.voidremoveCaAlias(String aliasName)Remove the aliasaliasName.voidremoveCertificate(String caName, BigInteger serialNumber)Removes a certificate with the serial numberserialNumber, and issued by the CAcaName.voidremoveCertprofile(String profileName)Removes the certificate profileprofileName.voidremoveCertprofileFromCa(String profileName, String caName)Removes the support of the certprofileprofileNamefrom the CAcaName.voidremoveDbSchema(String name)voidremoveKeypairGen(String name)Removes the keypair generation entryname.voidremovePublisher(String publisherName)Removes the publisherpublisherName.voidremovePublisherFromCa(String publisherName, String caName)Removes publisherpublisherNamefrom the CAcaName.voidremoveRequestor(String requestorName)Removes requestor namedrequestorName.voidremoveRequestorFromCa(String requestorName, String caName)Removes the requestorrequestorNamefrom the CAcaName.voidremoveSigner(String name)Removes the signer namedname.voidrepublishCertificates(String caName, List<String> publisherNames, int numThreads)Republishes certificates of the CAcaNameto the publisherspublisherNames.voidrestartCa(String caName)Restart the given CA.voidrestartCaSystem()Restart the whole CA system.voidrevokeCa(String caName, org.xipki.security.CertRevocationInfo revocationInfo)Revokes the CAcaName.voidrevokeCertificate(String caName, BigInteger serialNumber, org.xipki.security.CrlReason reason, Instant invalidityTime)Revokes a certificate with the serial numberserialNumber, and issued by the CAcaName.voidunlockCa()voidunrevokeCa(String caName)Unrevokes the CAcaName.voidunsuspendCertificate(String caName, BigInteger serialNumber)Unrevokes a certificate with the serial numberserialNumber, and issued by the CAcaName.
-
-
-
Field Detail
-
NULL
static final String NULL
- See Also:
- Constant Field Values
-
MIN_SERIALNUMBER_SIZE
static final int MIN_SERIALNUMBER_SIZE
Although it is possible to configure it to 1, it is recommended to set it to at least 9. At least 64 bit entropy is required. Since the highest bit is set to 0, at least 9 bytes is recommended.- See Also:
- Constant Field Values
-
MAX_SERIALNUMBER_SIZE
static final int MAX_SERIALNUMBER_SIZE
Since serial number should be positive and maximal 20 bytes.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCaSystemStatus
CaSystemStatus getCaSystemStatus() throws CaMgmtException
- Throws:
CaMgmtException
-
unlockCa
void unlockCa() throws CaMgmtException- Throws:
CaMgmtException
-
notifyCaChange
void notifyCaChange() throws CaMgmtException- Throws:
CaMgmtException
-
addDbSchema
void addDbSchema(String name, String value) throws CaMgmtException
- Throws:
CaMgmtException
-
changeDbSchema
void changeDbSchema(String name, String value) throws CaMgmtException
- Throws:
CaMgmtException
-
removeDbSchema
void removeDbSchema(String name) throws CaMgmtException
- Throws:
CaMgmtException
-
getDbSchemas
Map<String,String> getDbSchemas() throws CaMgmtException
- Throws:
CaMgmtException
-
republishCertificates
void republishCertificates(String caName, List<String> publisherNames, int numThreads) throws CaMgmtException
Republishes certificates of the CAcaNameto the publisherspublisherNames.- Parameters:
caName- CA name. Could benull.publisherNames- Publisher names. Could benull.numThreads- Number of threads- Throws:
CaMgmtException- if error occurs.
-
clearPublishQueue
void clearPublishQueue(String caName, List<String> publisherNames) throws CaMgmtException
Clear the publishing queue for the CAcaNameand publisherspublisherNames.- Parameters:
caName- CA name. Could benull.publisherNames- Publisher names. Could benull.- Throws:
CaMgmtException- if error occurs.
-
removeCa
void removeCa(String caName) throws CaMgmtException
Removes the CAcaNamefrom the system.- Parameters:
caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
restartCa
void restartCa(String caName) throws CaMgmtException
Restart the given CA.- Parameters:
caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
restartCaSystem
void restartCaSystem() throws CaMgmtExceptionRestart the whole CA system.- Throws:
CaMgmtException- if error occurs.
-
addCaAlias
void addCaAlias(String aliasName, String caName) throws CaMgmtException
Adds the aliasaliasNameto the given CAcaName.- Parameters:
aliasName- CA alias name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removeCaAlias
void removeCaAlias(String aliasName) throws CaMgmtException
Remove the aliasaliasName.- Parameters:
aliasName- Alias name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getAliasesForCa
Set<String> getAliasesForCa(String caName) throws CaMgmtException
Gets the aliases of the given CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the aliases of the given CA.
- Throws:
CaMgmtException- if error occurs.
-
getCaNameForAlias
String getCaNameForAlias(String aliasName) throws CaMgmtException
Gets the CA name for the aliasaliasName.- Parameters:
aliasName- CA alias name. Must not benull.- Returns:
- the aliases of the given CA.
- Throws:
CaMgmtException- if error occurs.
-
getCaAliasNames
Set<String> getCaAliasNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getCertprofileNames
Set<String> getCertprofileNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getKeypairGenNames
Set<String> getKeypairGenNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getPublisherNames
Set<String> getPublisherNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getRequestorNames
Set<String> getRequestorNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getSignerNames
Set<String> getSignerNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getCaNames
Set<String> getCaNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getSuccessfulCaNames
Set<String> getSuccessfulCaNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getFailedCaNames
Set<String> getFailedCaNames() throws CaMgmtException
- Throws:
CaMgmtException
-
getInactiveCaNames
Set<String> getInactiveCaNames() throws CaMgmtException
- Throws:
CaMgmtException
-
addCa
void addCa(CaEntry caEntry) throws CaMgmtException
Adds a CA.- Parameters:
caEntry- CA to be added. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getCa
CaEntry getCa(String caName) throws CaMgmtException
Gets the CA namedcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the CaEntry
- Throws:
CaMgmtException- if error occurs.
-
changeCa
void changeCa(ChangeCaEntry changeCaEntry) throws CaMgmtException
Changes a CA.- Parameters:
changeCaEntry- ChangeCA entry. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removeCertprofileFromCa
void removeCertprofileFromCa(String profileName, String caName) throws CaMgmtException
Removes the support of the certprofileprofileNamefrom the CAcaName.- Parameters:
profileName- Profile name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
addCertprofileToCa
void addCertprofileToCa(String profileName, String caName) throws CaMgmtException
Add the certificate profileprofileNamethe CAcaName.- Parameters:
profileName- Profile name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removePublisherFromCa
void removePublisherFromCa(String publisherName, String caName) throws CaMgmtException
Removes publisherpublisherNamefrom the CAcaName.- Parameters:
publisherName- Publisher name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
addPublisherToCa
void addPublisherToCa(String publisherName, String caName) throws CaMgmtException
Adds publisherpublisherNameto CAcaName.- Parameters:
publisherName- Publisher name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getCertprofilesForCa
Set<String> getCertprofilesForCa(String caName) throws CaMgmtException
Returns the Certprofile names supported by the CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the Certprofile names.
- Throws:
CaMgmtException- if error occurs.
-
getRequestorsForCa
Set<CaHasRequestorEntry> getRequestorsForCa(String caName) throws CaMgmtException
Returns the Requests supported by the CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the requestors.
- Throws:
CaMgmtException- if error occurs.
-
getRequestor
RequestorEntry getRequestor(String name) throws CaMgmtException
Returns the requestor namedname.- Parameters:
name- Requestor name. Must not benull.- Returns:
- the requestor.
- Throws:
CaMgmtException- if error occurs.
-
addRequestor
void addRequestor(RequestorEntry requestorEntry) throws CaMgmtException
Adds requstor.- Parameters:
requestorEntry- Requestor entry. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removeRequestor
void removeRequestor(String requestorName) throws CaMgmtException
Removes requestor namedrequestorName.- Parameters:
requestorName- Requestor name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
changeRequestor
void changeRequestor(String name, String type, String conf) throws CaMgmtException
Changes the requestornameof type CERTIFCATE.- Parameters:
name- name of the certificate profile to be changed. Must not benull.type- Type to be changed.nullindicates no change.conf- Configuration to be changed.nullindicates no change.- Throws:
CaMgmtException- if error occurs.
-
removeRequestorFromCa
void removeRequestorFromCa(String requestorName, String caName) throws CaMgmtException
Removes the requestorrequestorNamefrom the CAcaName.- Parameters:
requestorName- Requestor name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
addRequestorToCa
void addRequestorToCa(CaHasRequestorEntry requestor, String caName) throws CaMgmtException
Adds the requestorrequestorNameto the CAcaName.- Parameters:
requestor- Requestor name. Must not benull.caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getCertprofile
CertprofileEntry getCertprofile(String profileName) throws CaMgmtException
Returns the certificate profile namedprofileName.- Parameters:
profileName- certificate profile name. Must not benull.- Returns:
- the profile
- Throws:
CaMgmtException- if error occurs.
-
removeCertprofile
void removeCertprofile(String profileName) throws CaMgmtException
Removes the certificate profileprofileName.- Parameters:
profileName- certificate profile name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
changeCertprofile
void changeCertprofile(String name, String type, String conf) throws CaMgmtException
Changes the certificate profilename.- Parameters:
name- name of the certificate profile to be changed. Must not benull.type- Type to be changed.nullindicates no change.conf- Configuration to be changed.nullindicates no change.- Throws:
CaMgmtException- if error occurs.
-
addCertprofile
void addCertprofile(CertprofileEntry certprofileEntry) throws CaMgmtException
Adds a certificate profile.- Parameters:
certprofileEntry- Certificate profile entry. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getKeypairGen
KeypairGenEntry getKeypairGen(String name) throws CaMgmtException
Returns the keypair generation entry namedprofileName.- Parameters:
name- keypair generation name. Must not benull.- Returns:
- the keypair generation entry
- Throws:
CaMgmtException- if error occurs.
-
removeKeypairGen
void removeKeypairGen(String name) throws CaMgmtException
Removes the keypair generation entryname.- Parameters:
name- keypair generation name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
changeKeypairGen
void changeKeypairGen(String name, String type, String conf) throws CaMgmtException
Changes the keypair generation entryname.- Parameters:
name- name of the keypair generation entry to be changed. Must not benull.type- Type to be changed.nullindicates no change.conf- Configuration to be changed.nullindicates no change.- Throws:
CaMgmtException- if error occurs.
-
addKeypairGen
void addKeypairGen(KeypairGenEntry keypairGenEntry) throws CaMgmtException
Adds a keypair generation entry.- Parameters:
keypairGenEntry- Keypair generation entry. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
addSigner
void addSigner(SignerEntry signerEntry) throws CaMgmtException
Adds a signer.- Parameters:
signerEntry- Signer entry. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removeSigner
void removeSigner(String name) throws CaMgmtException
Removes the signer namedname.- Parameters:
name- Signer name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
getSigner
SignerEntry getSigner(String name) throws CaMgmtException
Returns the signer namedname.- Parameters:
name- Signer name. Must not benull.- Returns:
- the signer.
- Throws:
CaMgmtException- if error occurs.
-
changeSigner
void changeSigner(String name, String type, String conf, String base64Cert) throws CaMgmtException
Changes the signername.- Parameters:
name- name of the signer to be changed. Must not benull.type- Type to be changed.nullindicates no change.conf- Configuration to be changed.nullindicates no change.base64Cert- Base64 encoded certificate of the signer.nullindicates no change.- Throws:
CaMgmtException- if error occurs.
-
addPublisher
void addPublisher(PublisherEntry entry) throws CaMgmtException
Adds a publisher.- Parameters:
entry- Publisher entry.- Throws:
CaMgmtException- if error occurs.
-
getPublishersForCa
List<PublisherEntry> getPublishersForCa(String caName) throws CaMgmtException
Returns publishers for the CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- publishers for the given CA.
- Throws:
CaMgmtException- if error occurs.
-
getPublisher
PublisherEntry getPublisher(String publisherName) throws CaMgmtException
Returns the publisher.- Parameters:
publisherName- Publisher name. Must not benull.- Returns:
- the publisher.
- Throws:
CaMgmtException- if error occurs.
-
removePublisher
void removePublisher(String publisherName) throws CaMgmtException
Removes the publisherpublisherName.- Parameters:
publisherName- Publisher name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
changePublisher
void changePublisher(String name, String type, String conf) throws CaMgmtException
Changes the publishername.- Parameters:
name- name of the publisher to be changed. Must not benull.type- Type to be changed.nullindicates no change.conf- Configuration to be changed.nullindicates no change.- Throws:
CaMgmtException- if error occurs.
-
revokeCa
void revokeCa(String caName, org.xipki.security.CertRevocationInfo revocationInfo) throws CaMgmtException
Revokes the CAcaName.- Parameters:
caName- CA name. Must not benull.revocationInfo- Revocation information. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
unrevokeCa
void unrevokeCa(String caName) throws CaMgmtException
Unrevokes the CAcaName.- Parameters:
caName- CA name. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
revokeCertificate
void revokeCertificate(String caName, BigInteger serialNumber, org.xipki.security.CrlReason reason, Instant invalidityTime) throws CaMgmtException
Revokes a certificate with the serial numberserialNumber, and issued by the CAcaName.- Parameters:
caName- CA name. Must not benull.serialNumber- Serial number. Must not benull.reason- Revocation reason. Must not benull.invalidityTime- Invalidity time. Could benull.- Throws:
CaMgmtException- if error occurs.
-
unsuspendCertificate
void unsuspendCertificate(String caName, BigInteger serialNumber) throws CaMgmtException
Unrevokes a certificate with the serial numberserialNumber, and issued by the CAcaName.- Parameters:
caName- CA name. Must not benull.serialNumber- Serial number. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
removeCertificate
void removeCertificate(String caName, BigInteger serialNumber) throws CaMgmtException
Removes a certificate with the serial numberserialNumber, and issued by the CAcaName.- Parameters:
caName- CA name. Must not benull.serialNumber- Serial number. Must not benull.- Throws:
CaMgmtException- if error occurs.
-
generateCertificate
org.xipki.security.X509Cert generateCertificate(String caName, String profileName, byte[] encodedCsr, Instant notBefore, Instant notAfter) throws CaMgmtException
CAcaNameissues a new certificate.- Parameters:
caName- CA name. Must not benull.profileName- Name of the certificate profile. Must not benull.encodedCsr- CSR. Must not benull.notBefore- NotBefore. Could benull.notAfter- NotAfter. Could benull.- Returns:
- the issued certificate
- Throws:
CaMgmtException- if error occurs.
-
generateKeyCert
org.xipki.security.KeyCertBytesPair generateKeyCert(String caName, String profileName, String subject, Instant notBefore, Instant notAfter) throws CaMgmtException
CAcaNameissues a new certificate.- Parameters:
caName- CA name. Must not benull.profileName- Name of the certificate profile. Must not benull.subject- Subject. Must not benull.notBefore- NotBefore. Could benull.notAfter- NotAfter. Could benull.- Returns:
- the generated key and issued certificate
- Throws:
CaMgmtException- if error occurs.
-
generateCrossCertificate
org.xipki.security.X509Cert generateCrossCertificate(String caName, String profileName, byte[] encodedCsr, byte[] encodedTargetCert, Instant notBefore, Instant notAfter) throws CaMgmtException
CAcaNameissues a new certificate.- Parameters:
caName- CA name. Must not benull.profileName- Name of the certificate profile. Must not benull.encodedCsr- CSR. Must not benull.encodedTargetCert- certificate file, for which the cross certificate will be generated. There shall be not different in subject and public key between #encodedCsr and #encodedCert.notBefore- NotBefore.notAfter- NotAfter- Returns:
- the issued certificate
- Throws:
CaMgmtException- if error occurs.
-
generateRootCa
org.xipki.security.X509Cert generateRootCa(CaEntry caEntry, String certprofileName, String subject, String serialNumber, Instant notBefore, Instant notAfter) throws CaMgmtException
Generates a self-signed CA certificate.- Parameters:
caEntry- CA entry. Must not benull.certprofileName- Profile name of the root CA certificate. Must not benull.subject- Subject. Must not benull.serialNumber- Serial number.null: lets CA choose the serial number; fixed serialnumber: decimal or heximal (beginning with 0x) number; RANDOM:<size in bytes> random number with given length.notBefore- NotBefore.notAfter- NotAfter- Returns:
- the generated certificate
- Throws:
CaMgmtException- if error occurs.
-
generateCrlOnDemand
org.bouncycastle.cert.X509CRLHolder generateCrlOnDemand(String caName) throws CaMgmtException
Generates a new CRL for CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the generated CRL.
- Throws:
CaMgmtException- if error occurs.
-
getCrl
org.bouncycastle.cert.X509CRLHolder getCrl(String caName, BigInteger crlNumber) throws CaMgmtException
Returns the CRL of CAcaNamewith the CRL numbercrlNumber.- Parameters:
caName- CA name. Must not benull.crlNumber- CRL number. Must not benull.- Returns:
- the CRL.
- Throws:
CaMgmtException- if error occurs.
-
getCurrentCrl
org.bouncycastle.cert.X509CRLHolder getCurrentCrl(String caName) throws CaMgmtException
Returns the latest CRL of CAcaName.- Parameters:
caName- CA name. Must not benull.- Returns:
- the CRL.
- Throws:
CaMgmtException- if error occurs.
-
getCert
CertWithRevocationInfo getCert(String caName, BigInteger serialNumber) throws CaMgmtException
Returns certificate with status information for the CAcaNameand with serial numberserialNumber.- Parameters:
caName- CA name. Must not benull.serialNumber- Serial number. Must not benull.- Returns:
- the certificate with status information.
- Throws:
CaMgmtException- if error occurs.
-
getCert
CertWithRevocationInfo getCert(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber) throws CaMgmtException
Returns certificate with revocation information for theissuerand with serial numberserialNumber.- Parameters:
issuer- Issuer of the certificate. Must not benull.serialNumber- Serial number. Must not benull.- Returns:
- the certificate with status information.
- Throws:
CaMgmtException- if error occurs.
-
loadConf
Map<String,org.xipki.security.X509Cert> loadConf(InputStream zippedConfStream) throws CaMgmtException, IOException
Loads the CA system configuration.- Parameters:
zippedConfStream- Inputstream of the zipped Configuration the CA system. Must not benull.- Returns:
- map of generated root certificates, if newly generated. The key is the CA name.
- Throws:
IOException- If read the ZIP stream fails.CaMgmtException- if other error occurs.
-
exportConf
InputStream exportConf(List<String> caNames) throws CaMgmtException, IOException
Exports the CA system configuration to a zip-stream.- Parameters:
caNames- List of the names of CAs to be exported.nullto export all CAs.- Returns:
- ZIP stream of the CA system configuration.
- Throws:
IOException- If read the ZIP file fails.CaMgmtException- if non-IO error occurs.
-
listCertificates
List<CertListInfo> listCertificates(String caName, org.bouncycastle.asn1.x500.X500Name subjectPattern, Instant validFrom, Instant validTo, CertListOrderBy orderBy, int numEntries) throws CaMgmtException
Returns a sorted list of certificate meta information.- Parameters:
caName- CA name. Must not benull.subjectPattern- Subject pattern. Could benull.validFrom- Valid from. Could benull.validTo- Valid to. Could benull.orderBy- How the result is ordered. Could benull.numEntries- Maximal number of entries in the returned list.- Returns:
- a sorted list of certificate meta information.
- Throws:
CaMgmtException- if error occurs.
-
getSupportedSignerTypes
Set<String> getSupportedSignerTypes() throws CaMgmtException
Retrieves the types of supported signers.- Returns:
- lower-case types of supported signers, never
null. - Throws:
CaMgmtException- if error occurs.
-
getSupportedCertprofileTypes
Set<String> getSupportedCertprofileTypes() throws CaMgmtException
Retrieves the types of supported certificate profiles.- Returns:
- types of supported certificate profiles, never
null. - Throws:
CaMgmtException- if error occurs.
-
getSupportedPublisherTypes
Set<String> getSupportedPublisherTypes() throws CaMgmtException
Retrieves the types of supported publishers.- Returns:
- lower-case types of supported publishers, never
null. - Throws:
CaMgmtException- if error occurs.
-
getTokenInfoP11
String getTokenInfoP11(String moduleName, Integer slotIndex, boolean verbose) throws CaMgmtException
- Throws:
CaMgmtException
-
-