public class CertificateBuilder extends Object
new CertificateBuilder(signingCert).build();
will not fail, but it would be unwise to rely on the defaults and callers should
carefully consider initializing all values.
CertificateBuilder instances are reusable and the withXXX() methods
all return the existing builder, not a copy.
Each certificate should have a unique serial number. The build method
increments the serial number so if you use the same builder to create several
certificates then they will have consecutive serial numbers.
You can provide a KeyPair to the builder, or if you do not it will generate
one. The KeyPair is automatically cleared by the build method to prevent the
same key being used for multiple certificate inadvertently.| Constructor and Description |
|---|
CertificateBuilder(IIntermediateCertificate signingCert)
Create a CertificateBuilder for the given certificate signing certificate.
|
CertificateBuilder(IIntermediateCertificate signingCert,
CertificateBuilder other)
Create a CertificateBuilder for the given certificate signing certificate.
|
public CertificateBuilder(IIntermediateCertificate signingCert)
signingCert - a certificate signing certificate.public CertificateBuilder(IIntermediateCertificate signingCert, CertificateBuilder other)
signingCert - a certificate signing certificate.other - Another CertificateBuilder from which other parameters should be initialized.public CertificateBuilder withCertType(CertType certType)
public CertificateBuilder withNotBefore(Date notBefore)
public CertificateBuilder withNotAfter(Date notAfter)
public CertificateBuilder withValidityMonths(int months)
public CertificateBuilder withValidityDays(int days)
public CertificateBuilder withSerial(BigInteger serial)
public CertificateBuilder withOrgName(String orgName)
public CertificateBuilder withCountryName(String countryName)
public CertificateBuilder withStateName(String stateName)
public CertificateBuilder withOrganizationName(String orgName)
public CertificateBuilder withOrgUnitName(String orgUnitName)
public CertificateBuilder addOrgUnitName(String orgUnitName)
public CertificateBuilder withCommonName(String commonName)
public CertificateBuilder withOcspUrl(URL ocspUrl)
public CertificateBuilder withKeyPair(KeyPair keyPair) throws InvalidKeyException
keyPair - The KeyPair which is to be bound to the certificate.InvalidKeyException - If the given KeyPair is incompatible with the
CipherSuirte of the signing cert associated with this builder.public Date getNotBefore()
public Date getNotAfter()
public BigInteger getSerial()
public String getCountryName()
public String getStateName()
public String getOrgName()
public String getCommonName()
public CertType getCertType()
public KeyPair getKeyPair()
public URL getOcspUrl()
public IOpenCertificate build()
Copyright © 2018 Symphony Software Foundation. All rights reserved.