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

org.bouncycastle.crypto.tls

## Class CertificateRequest

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

-     public class CertificateRequest
      extends java.lang.Object

  Parsing and encoding of a CertificateRequest struct from RFC 4346.

       struct {
           ClientCertificateType certificate_types<1..2^8-1>;
           DistinguishedName certificate_authorities<3..2^16-1>;
       } CertificateRequest;

  See Also:
    `ClientCertificateType`, `X500Name`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Vector` | `certificateAuthorities`
    `protected short[]` | `certificateTypes`
    `protected java.util.Vector` | `supportedSignatureAlgorithms`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CertificateRequest(short[] certificateTypes, java.util.Vector supportedSignatureAlgorithms, java.util.Vector certificateAuthorities)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `encode(java.io.OutputStream output)` Encode this `CertificateRequest` to an `OutputStream`.
    `java.util.Vector` | `getCertificateAuthorities()`
    `short[]` | `getCertificateTypes()`
    `java.util.Vector` | `getSupportedSignatureAlgorithms()`
    `static CertificateRequest` | `parse(TlsContext context, java.io.InputStream input)` Parse a `CertificateRequest` from an `InputStream`.

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

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

- - ### Field Detail

    - #### certificateTypes

          protected short[] certificateTypes

    - #### supportedSignatureAlgorithms

          protected java.util.Vector supportedSignatureAlgorithms

    - #### certificateAuthorities

          protected java.util.Vector certificateAuthorities

  - ### Constructor Detail

    - #### CertificateRequest

          public CertificateRequest(short[] certificateTypes,
                            java.util.Vector supportedSignatureAlgorithms,
                            java.util.Vector certificateAuthorities)

      Parameters:
        `certificateTypes` - see `ClientCertificateType` for valid constants.
        `certificateAuthorities` - a `Vector` of `X500Name`.

  - ### Method Detail

    - #### getCertificateTypes

          public short[] getCertificateTypes()

      Returns:
        an array of certificate types
      See Also:
        `ClientCertificateType`

    - #### getSupportedSignatureAlgorithms

          public java.util.Vector getSupportedSignatureAlgorithms()

      Returns:
        a `Vector` of `SignatureAndHashAlgorithm` (or null before TLS 1.2).

    - #### getCertificateAuthorities

          public java.util.Vector getCertificateAuthorities()

      Returns:
        a `Vector` of `X500Name`

    - #### encode

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

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

    - #### parse

          public static CertificateRequest parse(TlsContext context,
                                 java.io.InputStream input)
                                          throws java.io.IOException

      Parse a `CertificateRequest` from an `InputStream`.
      Parameters:
        `context` - the `TlsContext` of the current connection.
        `input` - the `InputStream` to parse from.
      Returns:
        a `CertificateRequest` object.
      Throws:
        `java.io.IOException`