Class X509CertificateBuilder
java.lang.Object
eu.europa.esig.dss.pki.jaxb.builder.X509CertificateBuilder
Builds a
eu.europa.esig.dss.model.x509.CertificateToken
-
Constructor Summary
ConstructorDescriptionDefault constructor to create an empty instance of X509CertificateBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a certificate tokenca
(boolean ca) Sets whether the certificate is a CA certificateSets the AIA CA Issuers distribution point URLcertificatePolicies
(List<String> certificatePolicies) Sets the certificate policies for the certificateSets the CRL distribution point URLextendedKeyUsages
(List<String> extendedKeyUsages) Adds extended key usages certificate extensionissuer
(CertificateToken issuerCertificate, PrivateKey issuerPrivateKey, SignatureAlgorithm signatureAlgorithm) Sets mandatory information about the certificate's issuer to sign the created certificate with a CertificateToken of the issuerissuer
(org.bouncycastle.asn1.x500.X500Name issuerName, PrivateKey issuerPrivateKey, SignatureAlgorithm signatureAlgorithm) Sets mandatory information about the certificate's issuer to sign the created certificatekeyUsages
(List<KeyUsageBit> keyUsages) Sets the key usages for the certificateSets mandatory information about the certificate's notAfter fieldSets mandatory information about the certificate's notBefore fieldSets the OCSP access point URLocspNoCheck
(boolean ocspNoCheck) Sets whether the ocsp-no-check extension shall be presentqcCClegislations
(List<String> qcCClegislations) Sets the QcCCLegislation IdsqcStatements
(List<String> qcStatements) Sets the QcStatement IdsSets the QcType Idssubject
(org.bouncycastle.asn1.x500.X500Name subjectName, BigInteger serialNumber, PublicKey publicKey) Sets mandatory information about the certificate
-
Constructor Details
-
X509CertificateBuilder
public X509CertificateBuilder()Default constructor to create an empty instance of X509CertificateBuilder. Methods#subject
andissuer
shall be called at minimum to create aX509CertificateHolder
-
-
Method Details
-
subject
public X509CertificateBuilder subject(org.bouncycastle.asn1.x500.X500Name subjectName, BigInteger serialNumber, PublicKey publicKey) Sets mandatory information about the certificate- Parameters:
subjectName
-X500Name
representing a DN subject name of the certificate to be createdserialNumber
-BigInteger
representing a certificate's serial numberpublicKey
-PublicKey
of the certificate to be created- Returns:
X509CertificateBuilder
this
-
issuer
public X509CertificateBuilder issuer(org.bouncycastle.asn1.x500.X500Name issuerName, PrivateKey issuerPrivateKey, SignatureAlgorithm signatureAlgorithm) Sets mandatory information about the certificate's issuer to sign the created certificate- Parameters:
issuerName
-X500Name
representing a DN issuer name of the certificate to be createdissuerPrivateKey
-PrivateKey
of the issuer certificate to sign the certificatesignatureAlgorithm
-SignatureAlgorithm
to be used on signature creation- Returns:
X509CertificateBuilder
this
-
issuer
public X509CertificateBuilder issuer(CertificateToken issuerCertificate, PrivateKey issuerPrivateKey, SignatureAlgorithm signatureAlgorithm) Sets mandatory information about the certificate's issuer to sign the created certificate with a CertificateToken of the issuer- Parameters:
issuerCertificate
-CertificateToken
representing a certificate token of the issuerissuerPrivateKey
-PrivateKey
of the issuer certificate to sign the certificatesignatureAlgorithm
-SignatureAlgorithm
to be used on signature creation- Returns:
X509CertificateBuilder
this
-
notBefore
Sets mandatory information about the certificate's notBefore field- Parameters:
notBefore
-Date
representing a certificate's notBefore time- Returns:
X509CertificateBuilder
this
-
notAfter
Sets mandatory information about the certificate's notAfter field- Parameters:
notAfter
-Date
representing a certificate's notAfter time- Returns:
X509CertificateBuilder
this
-
keyUsages
Sets the key usages for the certificate- Parameters:
keyUsages
- a list ofKeyUsageBit
s- Returns:
X509CertificateBuilder
this
-
certificatePolicies
Sets the certificate policies for the certificate- Parameters:
certificatePolicies
- a list ofString
certificate policy identifiers- Returns:
X509CertificateBuilder
this
-
qcStatements
Sets the QcStatement Ids- Parameters:
qcStatements
- a list ofString
qcStatement identifiers- Returns:
X509CertificateBuilder
this
-
qcTypes
Sets the QcType Ids- Parameters:
qcTypes
- a list ofString
qcType identifiers- Returns:
X509CertificateBuilder
this
-
qcCClegislations
Sets the QcCCLegislation Ids- Parameters:
qcCClegislations
- a list ofString
qcCCLegislation identifiers- Returns:
X509CertificateBuilder
this
-
ca
Sets whether the certificate is a CA certificate- Parameters:
ca
- whether the certificate is a CA certificate- Returns:
X509CertificateBuilder
this
-
ocspNoCheck
Sets whether the ocsp-no-check extension shall be present- Parameters:
ocspNoCheck
- whether the ocsp-no-check extension shall be present- Returns:
X509CertificateBuilder
this
-
extendedKeyUsages
Adds extended key usages certificate extension- Parameters:
extendedKeyUsages
- a list ofString
OIDs- Returns:
X509CertificateBuilder
this
-
crl
Sets the CRL distribution point URL- Parameters:
crlUrl
-String
- Returns:
X509CertificateBuilder
this
-
ocsp
Sets the OCSP access point URL- Parameters:
ocspUrl
-String
- Returns:
X509CertificateBuilder
this
-
caIssuers
Sets the AIA CA Issuers distribution point URL- Parameters:
caIssuersUrl
-String
- Returns:
X509CertificateBuilder
this
-
build
public CertificateToken build() throws org.bouncycastle.operator.OperatorCreationException, IOExceptionBuilds a certificate token- Returns:
CertificateToken
- Throws:
org.bouncycastle.operator.OperatorCreationException
- if an error on certificate signing occursIOException
- if an error on certificate's content creation occurs
-