public class

X509v3CertificateBuilder

extends Object
java.lang.Object
   ↳ org.bouncycastle.cert.X509v3CertificateBuilder
Known Direct Subclasses

Class Overview

class to produce an X.509 Version 3 certificate.

Summary

Public Constructors
X509v3CertificateBuilder(X500Name issuer, BigInteger serial, Date notBefore, Date notAfter, X500Name subject, SubjectPublicKeyInfo publicKeyInfo)
Create a builder for a version 3 certificate.
Public Methods
X509v3CertificateBuilder addExtension(ASN1ObjectIdentifier oid, boolean isCritical, ASN1Encodable value)
Add a given extension field for the standard extensions tag (tag 3)
X509CertificateHolder build(ContentSigner signer)
Generate an X.509 certificate, based on the current issuer and subject using the passed in signer.
X509v3CertificateBuilder copyAndAddExtension(ASN1ObjectIdentifier oid, boolean isCritical, X509CertificateHolder certHolder)
Add a given extension field for the standard extensions tag (tag 3) copying the extension value from another certificate.
X509v3CertificateBuilder setIssuerUniqueID(boolean[] uniqueID)
Set the issuerUniqueID - note: it is very rare that it is correct to do this.
X509v3CertificateBuilder setSubjectUniqueID(boolean[] uniqueID)
Set the subjectUniqueID - note: it is very rare that it is correct to do this.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public X509v3CertificateBuilder (X500Name issuer, BigInteger serial, Date notBefore, Date notAfter, X500Name subject, SubjectPublicKeyInfo publicKeyInfo)

Create a builder for a version 3 certificate.

Parameters
issuer the certificate issuer
serial the certificate serial number
notBefore the date before which the certificate is not valid
notAfter the date after which the certificate is not valid
subject the certificate subject
publicKeyInfo the info structure for the public key to be associated with this certificate.

Public Methods

public X509v3CertificateBuilder addExtension (ASN1ObjectIdentifier oid, boolean isCritical, ASN1Encodable value)

Add a given extension field for the standard extensions tag (tag 3)

Parameters
oid the OID defining the extension type.
isCritical true if the extension is critical, false otherwise.
value the ASN.1 structure that forms the extension's value.
Returns
  • this builder object.

public X509CertificateHolder build (ContentSigner signer)

Generate an X.509 certificate, based on the current issuer and subject using the passed in signer.

Parameters
signer the content signer to be used to generate the signature validating the certificate.
Returns
  • a holder containing the resulting signed certificate.

public X509v3CertificateBuilder copyAndAddExtension (ASN1ObjectIdentifier oid, boolean isCritical, X509CertificateHolder certHolder)

Add a given extension field for the standard extensions tag (tag 3) copying the extension value from another certificate.

Parameters
oid the OID defining the extension type.
isCritical true if the copied extension is to be marked as critical, false otherwise.
certHolder the holder for the certificate that the extension is to be copied from.
Returns
  • this builder object.

public X509v3CertificateBuilder setIssuerUniqueID (boolean[] uniqueID)

Set the issuerUniqueID - note: it is very rare that it is correct to do this.

Parameters
uniqueID a boolean array representing the bits making up the issuerUniqueID.
Returns
  • this builder object.

public X509v3CertificateBuilder setSubjectUniqueID (boolean[] uniqueID)

Set the subjectUniqueID - note: it is very rare that it is correct to do this.

Parameters
uniqueID a boolean array representing the bits making up the subjectUniqueID.
Returns
  • this builder object.