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

org.bouncycastle.crypto.tls

## Class Certificate

- java.lang.Object
- - org.bouncycastle.crypto.tls.Certificate

-     public class Certificate
      extends java.lang.Object

  Parsing and encoding of a Certificate struct from RFC 4346.

       opaque ASN.1Cert<2^24-1>;

       struct {
           ASN.1Cert certificate_list<0..2^24-1>;
       } Certificate;

  See Also:
    `Certificate`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Certificate[]` | `certificateList`
    `static Certificate` | `EMPTY_CHAIN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Certificate(Certificate[] certificateList)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Certificate[]` | `cloneCertificateList()`
    `void` | `encode(java.io.OutputStream output)` Encode this `Certificate` to an `OutputStream`.
    `Certificate` | `getCertificateAt(int index)`
    `Certificate[]` | `getCertificateList()`
    `int` | `getLength()`
    `boolean` | `isEmpty()`
    `static Certificate` | `parse(java.io.InputStream input)` Parse a `Certificate` from an `InputStream`.

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

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

- - ### Field Detail

    - #### EMPTY_CHAIN

          public static final Certificate EMPTY_CHAIN

    - #### certificateList

          protected Certificate[] certificateList

  - ### Constructor Detail

    - #### Certificate

          public Certificate(Certificate[] certificateList)

  - ### Method Detail

    - #### getCertificateList

          public Certificate[] getCertificateList()

      Returns:
        an array of `Certificate` representing a certificate chain.

    - #### getCertificateAt

          public Certificate getCertificateAt(int index)

    - #### getLength

          public int getLength()

    - #### isEmpty

          public boolean isEmpty()

      Returns:
        `true` if this certificate chain contains no certificates, or `false` otherwise.

    - #### encode

          public void encode(java.io.OutputStream output)
                      throws java.io.IOException

      Encode this `Certificate` to an `OutputStream`.
      Parameters:
        `output` - the `OutputStream` to encode to.
      Throws:
        `java.io.IOException`

    - #### parse

          public static Certificate parse(java.io.InputStream input)
                                   throws java.io.IOException

      Parse a `Certificate` from an `InputStream`.
      Parameters:
        `input` - the `InputStream` to parse from.
      Returns:
        a `Certificate` object.
      Throws:
        `java.io.IOException`

    - #### cloneCertificateList

          protected Certificate[] cloneCertificateList()