Package org.bouncycastle.asn1.eac

## Class CVCertificate

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.eac.CVCertificate

- All Implemented Interfaces:
    `ASN1Encodable`, `Encodable`

      public class CVCertificate
      extends ASN1Object

  an iso7816Certificate structure.

        Certificate ::= SEQUENCE {
            CertificateBody         Iso7816CertificateBody,
            signature               DER Application specific
        }

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CVCertificate​(ASN1InputStream aIS)` | Create an iso7816Certificate structure from an ASN1InputStream.
    `CVCertificate​(CertificateBody body, byte[] signature)` | Create an iso7816Certificate structure from a body and its signature.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CertificationAuthorityReference` | `getAuthorityReference()` |
    `CertificateBody` | `getBody()` | Gives the body of the certificate.
    `int` | `getCertificateType()` |
    `PackedDate` | `getEffectiveDate()` |
    `PackedDate` | `getExpirationDate()` |
    `ASN1ObjectIdentifier` | `getHolderAuthorization()` |
    `Flags` | `getHolderAuthorizationRights()` |
    `int` | `getHolderAuthorizationRole()` |
    `CertificateHolderReference` | `getHolderReference()` |
    `static CVCertificate` | `getInstance​(java.lang.Object obj)` | Create an iso7816Certificate structure from an object.
    `int` | `getRole()` | return a bits field coded on one byte.
    `byte[]` | `getSignature()` | Gives the signature of the whole body.
    `ASN1Primitive` | `toASN1Primitive()` | Method providing a primitive representation of this object suitable for encoding.

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode`

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

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

- - ### Constructor Detail

    - #### CVCertificate

          public CVCertificate​(ASN1InputStream aIS)
                        throws java.io.IOException

      Create an iso7816Certificate structure from an ASN1InputStream.
      Parameters:
        `aIS` - the byte stream to parse.
      Throws:
        `java.io.IOException` - if there is a problem parsing the data.

    - #### CVCertificate

          public CVCertificate​(CertificateBody body,
                               byte[] signature)
                        throws java.io.IOException

      Create an iso7816Certificate structure from a body and its signature.
      Parameters:
        `body` - the Iso7816CertificateBody object containing the body.
        `signature` - the byte array containing the signature
      Throws:
        `java.io.IOException` - if there is a problem parsing the data.

  - ### Method Detail

    - #### getInstance

          public static CVCertificate getInstance​(java.lang.Object obj)

      Create an iso7816Certificate structure from an object.
      Parameters:
        `obj` - the Object to extract the certificate from.
      Returns:
        the Iso7816CertificateStructure represented by the byte stream.

    - #### getSignature

          public byte[] getSignature()

      Gives the signature of the whole body. Type of signature is given in the Iso7816CertificateBody.Iso7816PublicKey.ASN1ObjectIdentifier
      Returns:
        the signature of the body.

    - #### getBody

          public CertificateBody getBody()

      Gives the body of the certificate.
      Returns:
        the body.

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

      Description copied from class: `ASN1Object`
      Method providing a primitive representation of this object suitable for encoding.
      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a primitive representation of this object.
      See Also:
        `ASN1Object.toASN1Primitive()`

    - #### getHolderAuthorization

          public ASN1ObjectIdentifier getHolderAuthorization()
                                                      throws java.io.IOException

      Returns:
        the Holder authorization and role (CVCA, DV, IS).
      Throws:
        `java.io.IOException`

    - #### getEffectiveDate

          public PackedDate getEffectiveDate()
                                      throws java.io.IOException

      Returns:
        the date of the certificate generation
      Throws:
        `java.io.IOException`

    - #### getCertificateType

          public int getCertificateType()

      Returns:
        the type of certificate (request or profile) value is either Iso7816CertificateBody.profileType or Iso7816CertificateBody.requestType. Any other value is not valid.

    - #### getExpirationDate

          public PackedDate getExpirationDate()
                                       throws java.io.IOException

      Returns:
        the date of the certificate generation
      Throws:
        `java.io.IOException`

    - #### getRole

          public int getRole()
                      throws java.io.IOException

      return a bits field coded on one byte. For signification of the several bit see Iso7816CertificateHolderAuthorization
      Returns:
        role and access rigth
      Throws:
        `java.io.IOException`
      See Also:
        `CertificateHolderAuthorization`

    - #### getAuthorityReference

          public CertificationAuthorityReference getAuthorityReference()
                                                                throws java.io.IOException

      Returns:
        the Authority Reference field of the certificate
      Throws:
        `java.io.IOException`

    - #### getHolderReference

          public CertificateHolderReference getHolderReference()
                                                        throws java.io.IOException

      Returns:
        the Holder Reference Field of the certificate
      Throws:
        `java.io.IOException`

    - #### getHolderAuthorizationRole

          public int getHolderAuthorizationRole()
                                         throws java.io.IOException

      Returns:
        the bits corresponding to the role intented for the certificate See Iso7816CertificateHolderAuthorization static int for values
      Throws:
        `java.io.IOException`

    - #### getHolderAuthorizationRights

          public Flags getHolderAuthorizationRights()
                                             throws java.io.IOException

      Returns:
        the bits corresponding the authorizations contained in the certificate See Iso7816CertificateHolderAuthorization static int for values
      Throws:
        `java.io.IOException`