JcaX509v3CertificateBuilder (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.cert.jcajce

## Class JcaX509v3CertificateBuilder

- java.lang.Object
- - org.bouncycastle.cert.X509v3CertificateBuilder
  - - org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder

-     public class JcaX509v3CertificateBuilder
      extends X509v3CertificateBuilder

  JCA helper class to allow JCA objects to be used in the construction of a Version 3 certificate.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JcaX509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serial, java.util.Date notBefore, java.util.Date notAfter, org.bouncycastle.asn1.x500.X500Name subject, java.security.PublicKey publicKey)` Initialise the builder using a PublicKey.
    `JcaX509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer, java.math.BigInteger serial, org.bouncycastle.asn1.x509.Time notBefore, org.bouncycastle.asn1.x509.Time notAfter, org.bouncycastle.asn1.x500.X500Name subject, java.security.PublicKey publicKey)` Initialise the builder using a PublicKey.
    `JcaX509v3CertificateBuilder(javax.security.auth.x500.X500Principal issuer, java.math.BigInteger serial, java.util.Date notBefore, java.util.Date notAfter, javax.security.auth.x500.X500Principal subject, java.security.PublicKey publicKey)` Initialise the builder using X500Principal objects and a PublicKey.
    `JcaX509v3CertificateBuilder(java.security.cert.X509Certificate issuerCert, java.math.BigInteger serial, java.util.Date notBefore, java.util.Date notAfter, org.bouncycastle.asn1.x500.X500Name subject, java.security.PublicKey publicKey)` Initialise the builder using the subject from the passed in issuerCert as the issuer, as well as passing through and converting the other objects provided.
    `JcaX509v3CertificateBuilder(java.security.cert.X509Certificate issuerCert, java.math.BigInteger serial, java.util.Date notBefore, java.util.Date notAfter, javax.security.auth.x500.X500Principal subject, java.security.PublicKey publicKey)` Initialise the builder using the subject from the passed in issuerCert as the issuer, as well as passing through and converting the other objects provided.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JcaX509v3CertificateBuilder` | `copyAndAddExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, boolean critical, java.security.cert.X509Certificate certificate)` Add a given extension field for the standard extensions tag (tag 3) copying the extension value from another certificate.

    - ### Methods inherited from class org.bouncycastle.cert.X509v3CertificateBuilder

      `addExtension, addExtension, build, copyAndAddExtension, setIssuerUniqueID, setSubjectUniqueID`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JcaX509v3CertificateBuilder

          public JcaX509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer,
                                     java.math.BigInteger serial,
                                     java.util.Date notBefore,
                                     java.util.Date notAfter,
                                     org.bouncycastle.asn1.x500.X500Name subject,
                                     java.security.PublicKey publicKey)

      Initialise the builder using a PublicKey.
      Parameters:
        `issuer` - X500Name representing the issuer of this certificate.
        `serial` - the serial number for the certificate.
        `notBefore` - date before which the certificate is not valid.
        `notAfter` - date after which the certificate is not valid.
        `subject` - X500Name representing the subject of this certificate.
        `publicKey` - the public key to be associated with the certificate.

    - #### JcaX509v3CertificateBuilder

          public JcaX509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer,
                                     java.math.BigInteger serial,
                                     org.bouncycastle.asn1.x509.Time notBefore,
                                     org.bouncycastle.asn1.x509.Time notAfter,
                                     org.bouncycastle.asn1.x500.X500Name subject,
                                     java.security.PublicKey publicKey)

      Initialise the builder using a PublicKey.
      Parameters:
        `issuer` - X500Name representing the issuer of this certificate.
        `serial` - the serial number for the certificate.
        `notBefore` - Time before which the certificate is not valid.
        `notAfter` - Time after which the certificate is not valid.
        `subject` - X500Name representing the subject of this certificate.
        `publicKey` - the public key to be associated with the certificate.

    - #### JcaX509v3CertificateBuilder

          public JcaX509v3CertificateBuilder(javax.security.auth.x500.X500Principal issuer,
                                     java.math.BigInteger serial,
                                     java.util.Date notBefore,
                                     java.util.Date notAfter,
                                     javax.security.auth.x500.X500Principal subject,
                                     java.security.PublicKey publicKey)

      Initialise the builder using X500Principal objects and a PublicKey.
      Parameters:
        `issuer` - principal representing the issuer of this certificate.
        `serial` - the serial number for the certificate.
        `notBefore` - date before which the certificate is not valid.
        `notAfter` - date after which the certificate is not valid.
        `subject` - principal representing the subject of this certificate.
        `publicKey` - the public key to be associated with the certificate.

    - #### JcaX509v3CertificateBuilder

          public JcaX509v3CertificateBuilder(java.security.cert.X509Certificate issuerCert,
                                     java.math.BigInteger serial,
                                     java.util.Date notBefore,
                                     java.util.Date notAfter,
                                     javax.security.auth.x500.X500Principal subject,
                                     java.security.PublicKey publicKey)

      Initialise the builder using the subject from the passed in issuerCert as the issuer, as well as passing through and converting the other objects provided.
      Parameters:
        `issuerCert` - certificate who's subject is the issuer of the certificate we are building.
        `serial` - the serial number for the certificate.
        `notBefore` - date before which the certificate is not valid.
        `notAfter` - date after which the certificate is not valid.
        `subject` - principal representing the subject of this certificate.
        `publicKey` - the public key to be associated with the certificate.

    - #### JcaX509v3CertificateBuilder

          public JcaX509v3CertificateBuilder(java.security.cert.X509Certificate issuerCert,
                                     java.math.BigInteger serial,
                                     java.util.Date notBefore,
                                     java.util.Date notAfter,
                                     org.bouncycastle.asn1.x500.X500Name subject,
                                     java.security.PublicKey publicKey)

      Initialise the builder using the subject from the passed in issuerCert as the issuer, as well as passing through and converting the other objects provided.
      Parameters:
        `issuerCert` - certificate who's subject is the issuer of the certificate we are building.
        `serial` - the serial number for the certificate.
        `notBefore` - date before which the certificate is not valid.
        `notAfter` - date after which the certificate is not valid.
        `subject` - principal representing the subject of this certificate.
        `publicKey` - the public key to be associated with the certificate.

  - ### Method Detail

    - #### copyAndAddExtension

          public JcaX509v3CertificateBuilder copyAndAddExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid,
                                                        boolean critical,
                                                        java.security.cert.X509Certificate certificate)
                                                          throws java.security.cert.CertificateEncodingException

      Add a given extension field for the standard extensions tag (tag 3) copying the extension value from another certificate.
      Parameters:
        `oid` - the type of the extension to be copied.
        `critical` - true if the extension is to be marked critical, false otherwise.
        `certificate` - the source of the extension to be copied.
      Returns:
        the builder instance.
      Throws:
        `java.security.cert.CertificateEncodingException`