Class BaseCertprofile

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public abstract class BaseCertprofile
    extends Certprofile
    Base Certprofile.
    Since:
    2.0.0
    Author:
    Lijun Liao (xipki)
    • Constructor Detail

      • BaseCertprofile

        protected BaseCertprofile()
    • Method Detail

      • getNotBefore

        public Instant getNotBefore​(Instant requestedNotBefore)
        Description copied from class: Certprofile
        Checks and gets the granted NotBefore.
        Specified by:
        getNotBefore in class Certprofile
        Parameters:
        requestedNotBefore - Requested NotBefore. Could be null.
        Returns:
        the granted NotBefore.
      • getSubject

        public Certprofile.SubjectInfo getSubject​(org.bouncycastle.asn1.x500.X500Name requestedSubject)
                                           throws CertprofileException,
                                                  org.xipki.util.exception.BadCertTemplateException
        Description copied from class: Certprofile
        Checks the requested subject. If the check passes, returns the canonicalized subject.
        Specified by:
        getSubject in class Certprofile
        Parameters:
        requestedSubject - Requested subject. Must not be null.
        Returns:
        the granted subject
        Throws:
        CertprofileException - if error occurs.
        org.xipki.util.exception.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.util.exception.BadCertTemplateException
        Description copied from class: Certprofile
        Checks the requested subject. If the check passes, returns the canonicalized subject.
        Overrides:
        getSubject in class Certprofile
        Parameters:
        requestedSubject - Requested subject. Must not be null.
        publicKeyInfo - SubjectPublicKeyInfo of the certificate.
        Returns:
        the granted subject
        Throws:
        CertprofileException - if error occurs.
        org.xipki.util.exception.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.util.exception.BadCertTemplateException
        Description copied from class: Certprofile
        Checks the public key. If the check passes, returns the canonicalized public key.
        Specified by:
        checkPublicKey in class Certprofile
        Parameters:
        publicKey - Requested public key. Must not be null.
        Returns:
        the granted public key.
        Throws:
        CertprofileException - if error occurs.
        org.xipki.util.exception.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.util.exception.BadCertTemplateException
        Throws:
        org.xipki.util.exception.BadCertTemplateException
      • createSubjectRdn

        protected org.bouncycastle.asn1.x500.RDN createSubjectRdn​(String text,
                                                                  org.bouncycastle.asn1.ASN1ObjectIdentifier type,
                                                                  Certprofile.RdnControl option)
                                                           throws org.xipki.util.exception.BadCertTemplateException
        Throws:
        org.xipki.util.exception.BadCertTemplateException
      • createGeneralName

        public static org.bouncycastle.asn1.x509.GeneralName createGeneralName​(org.bouncycastle.asn1.x509.GeneralName requestedName,
                                                                               Set<Certprofile.GeneralNameMode> modes)
                                                                        throws org.xipki.util.exception.BadCertTemplateException
        Creates GeneralName.
        Parameters:
        requestedName - Requested name. Must not be null.
        modes - Modes to be considered. Must not be null.
        Returns:
        the created GeneralName
        Throws:
        org.xipki.util.exception.BadCertTemplateException - If requestedName is invalid or contains entries which are not allowed in the modes.