Package org.xipki.ca.api.profile
Class BaseCertprofile
- java.lang.Object
-
- org.xipki.ca.api.profile.Certprofile
-
- org.xipki.ca.api.profile.BaseCertprofile
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public abstract class BaseCertprofile extends Certprofile
Base Certprofile.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.xipki.ca.api.profile.Certprofile
Certprofile.AuthorityInfoAccessControl, Certprofile.CertDomain, Certprofile.CertLevel, Certprofile.CrlDistributionPointsControl, Certprofile.ExtensionControl, Certprofile.ExtKeyUsageControl, Certprofile.GeneralNameMode, Certprofile.GeneralNameTag, Certprofile.KeyUsageControl, Certprofile.RdnControl, Certprofile.StringType, Certprofile.SubjectControl, Certprofile.SubjectInfo, Certprofile.X509CertVersion
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseCertprofile()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.asn1.x509.SubjectPublicKeyInfocheckPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKey)Checks the public key.static org.bouncycastle.asn1.x509.GeneralNamecreateGeneralName(org.bouncycastle.asn1.x509.GeneralName requestedName, Set<Certprofile.GeneralNameMode> modes)Creates GeneralName.protected org.bouncycastle.asn1.x500.RDNcreateSubjectRdn(String text, org.bouncycastle.asn1.ASN1ObjectIdentifier type, Certprofile.RdnControl option)Certprofile.AuthorityInfoAccessControlgetAiaControl()Certprofile.CertDomaingetCertDomain()Certprofile.CrlDistributionPointsControlgetCrlDpControl()Certprofile.CrlDistributionPointsControlgetFreshestCrlControl()abstract Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,KeyParametersOption>getKeyAlgorithms()InstantgetNotBefore(Instant requestedNotBefore)Checks and gets the granted NotBefore.IntegergetPathLenBasicConstraint()Certprofile.SubjectInfogetSubject(org.bouncycastle.asn1.x500.X500Name requestedSubject)Checks the requested subject.Certprofile.SubjectInfogetSubject(org.bouncycastle.asn1.x500.X500Name requestedSubject, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)Checks the requested subject.protected abstract voidverifySubjectDnOccurrence(org.bouncycastle.asn1.x500.X500Name requestedSubject)-
Methods inherited from class org.xipki.ca.api.profile.Certprofile
close, generateSerialNumber, getCertificatePolicies, getCertLevel, getExtendedKeyUsages, getExtensionControls, getExtensions, getKeypairGenControl, getKeyUsage, getMaxCertSize, getNotAfterMode, getSerialNumberMode, getSignatureAlgorithms, getSubjectAltNameModes, getSubjectControl, getSubjectInfoAccessModes, getSubjectKeyIdentifier, getSubjectKeyIdentifierControl, getValidity, getVersion, hasNoWellDefinedExpirationDate, initialize, useIssuerAndSerialInAki
-
-
-
-
Method Detail
-
getKeyAlgorithms
public abstract Map<org.bouncycastle.asn1.ASN1ObjectIdentifier,KeyParametersOption> getKeyAlgorithms()
- Specified by:
getKeyAlgorithmsin classCertprofile
-
getCertDomain
public Certprofile.CertDomain getCertDomain()
- Specified by:
getCertDomainin classCertprofile
-
getPathLenBasicConstraint
public Integer getPathLenBasicConstraint()
- Specified by:
getPathLenBasicConstraintin classCertprofile
-
getAiaControl
public Certprofile.AuthorityInfoAccessControl getAiaControl()
- Specified by:
getAiaControlin classCertprofile
-
getCrlDpControl
public Certprofile.CrlDistributionPointsControl getCrlDpControl()
- Specified by:
getCrlDpControlin classCertprofile
-
getFreshestCrlControl
public Certprofile.CrlDistributionPointsControl getFreshestCrlControl()
- Specified by:
getFreshestCrlControlin classCertprofile
-
getNotBefore
public Instant getNotBefore(Instant requestedNotBefore)
Description copied from class:CertprofileChecks and gets the granted NotBefore.- Specified by:
getNotBeforein classCertprofile- Parameters:
requestedNotBefore- Requested NotBefore. Could benull.- Returns:
- the granted NotBefore.
-
getSubject
public Certprofile.SubjectInfo getSubject(org.bouncycastle.asn1.x500.X500Name requestedSubject) throws CertprofileException, org.xipki.pki.BadCertTemplateException
Description copied from class:CertprofileChecks the requested subject. If the check passes, returns the canonicalized subject.- Specified by:
getSubjectin classCertprofile- Parameters:
requestedSubject- Requested subject. Must not benull.- Returns:
- the granted subject
- Throws:
CertprofileException- if error occurs.org.xipki.pki.BadCertTemplateException- if the subject is not permitted.
-
getSubject
public Certprofile.SubjectInfo getSubject(org.bouncycastle.asn1.x500.X500Name requestedSubject, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo) throws CertprofileException, org.xipki.pki.BadCertTemplateException
Description copied from class:CertprofileChecks the requested subject. If the check passes, returns the canonicalized subject.- Overrides:
getSubjectin classCertprofile- Parameters:
requestedSubject- Requested subject. Must not benull.publicKeyInfo- SubjectPublicKeyInfo of the certificate.- Returns:
- the granted subject
- Throws:
CertprofileException- if error occurs.org.xipki.pki.BadCertTemplateException- if the subject is not permitted.
-
checkPublicKey
public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo checkPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKey) throws CertprofileException, org.xipki.pki.BadCertTemplateExceptionDescription copied from class:CertprofileChecks the public key. If the check passes, returns the canonicalized public key.- Specified by:
checkPublicKeyin classCertprofile- Parameters:
publicKey- Requested public key. Must not benull.- Returns:
- the granted public key.
- Throws:
CertprofileException- if error occurs.org.xipki.pki.BadCertTemplateException- if the publicKey does not have correct format or is not permitted.
-
verifySubjectDnOccurrence
protected abstract void verifySubjectDnOccurrence(org.bouncycastle.asn1.x500.X500Name requestedSubject) throws org.xipki.pki.BadCertTemplateException- Throws:
org.xipki.pki.BadCertTemplateException
-
createSubjectRdn
protected org.bouncycastle.asn1.x500.RDN createSubjectRdn(String text, org.bouncycastle.asn1.ASN1ObjectIdentifier type, Certprofile.RdnControl option) throws org.xipki.pki.BadCertTemplateException
- Throws:
org.xipki.pki.BadCertTemplateException
-
createGeneralName
public static org.bouncycastle.asn1.x509.GeneralName createGeneralName(org.bouncycastle.asn1.x509.GeneralName requestedName, Set<Certprofile.GeneralNameMode> modes) throws org.xipki.pki.BadCertTemplateExceptionCreates GeneralName.- Parameters:
requestedName- Requested name. Must not benull.modes- Modes to be considered. Must not benull.- Returns:
- the created GeneralName
- Throws:
org.xipki.pki.BadCertTemplateException- If requestedName is invalid or contains entries which are not allowed in the modes.
-
-