TlsDHKeyExchange (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.crypto.tls

## Class TlsDHKeyExchange

- java.lang.Object
- - org.bouncycastle.crypto.tls.AbstractTlsKeyExchange
  - - org.bouncycastle.crypto.tls.TlsDHKeyExchange

- All Implemented Interfaces:
    TlsKeyExchange
  Direct Known Subclasses:
    TlsDHEKeyExchange

      public class TlsDHKeyExchange
      extends AbstractTlsKeyExchange

  (D)TLS DH key exchange.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TlsAgreementCredentials` | `agreementCredentials`
    `protected DHPrivateKeyParameters` | `dhAgreePrivateKey`
    `protected DHPublicKeyParameters` | `dhAgreePublicKey`
    `protected DHParameters` | `dhParameters`
    `protected AsymmetricKeyParameter` | `serverPublicKey`
    `protected TlsSigner` | `tlsSigner`

    - ### Fields inherited from class org.bouncycastle.crypto.tls.AbstractTlsKeyExchange

      `context, keyExchange, supportedSignatureAlgorithms`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TlsDHKeyExchange(int keyExchange, java.util.Vector supportedSignatureAlgorithms, DHParameters dhParameters)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `generateClientKeyExchange(java.io.OutputStream output)`
    `byte[]` | `generatePremasterSecret()`
    `protected int` | `getMinimumPrimeBits()`
    `void` | `init(TlsContext context)`
    `void` | `processClientCertificate(Certificate clientCertificate)`
    `void` | `processClientCredentials(TlsCredentials clientCredentials)`
    `void` | `processClientKeyExchange(java.io.InputStream input)`
    `void` | `processServerCertificate(Certificate serverCertificate)`
    `boolean` | `requiresServerKeyExchange()`
    `void` | `skipServerCredentials()`
    `void` | `validateCertificateRequest(CertificateRequest certificateRequest)`
    `protected DHParameters` | `validateDHParameters(DHParameters params)`

    - ### Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsKeyExchange

      `generateServerKeyExchange, parseSignature, processServerCredentials, processServerKeyExchange, skipClientCredentials, skipServerKeyExchange`

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

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

- - ### Field Detail

    - #### tlsSigner

          protected TlsSigner tlsSigner

    - #### dhParameters

          protected DHParameters dhParameters

    - #### serverPublicKey

          protected AsymmetricKeyParameter serverPublicKey

    - #### agreementCredentials

          protected TlsAgreementCredentials agreementCredentials

    - #### dhAgreePrivateKey

          protected DHPrivateKeyParameters dhAgreePrivateKey

    - #### dhAgreePublicKey

          protected DHPublicKeyParameters dhAgreePublicKey

  - ### Constructor Detail

    - #### TlsDHKeyExchange

          public TlsDHKeyExchange(int keyExchange,
                          java.util.Vector supportedSignatureAlgorithms,
                          DHParameters dhParameters)

  - ### Method Detail

    - #### init

          public void init(TlsContext context)

      Specified by:
        `init` in interface `TlsKeyExchange`
      Overrides:
        `init` in class `AbstractTlsKeyExchange`

    - #### skipServerCredentials

          public void skipServerCredentials()
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### processServerCertificate

          public void processServerCertificate(Certificate serverCertificate)
                                        throws java.io.IOException

      Specified by:
        `processServerCertificate` in interface `TlsKeyExchange`
      Overrides:
        `processServerCertificate` in class `AbstractTlsKeyExchange`
      Throws:
        `java.io.IOException`

    - #### requiresServerKeyExchange

          public boolean requiresServerKeyExchange()

      Specified by:
        `requiresServerKeyExchange` in interface `TlsKeyExchange`
      Overrides:
        `requiresServerKeyExchange` in class `AbstractTlsKeyExchange`

    - #### validateCertificateRequest

          public void validateCertificateRequest(CertificateRequest certificateRequest)
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### processClientCredentials

          public void processClientCredentials(TlsCredentials clientCredentials)
                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### generateClientKeyExchange

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

      Throws:
        `java.io.IOException`

    - #### processClientCertificate

          public void processClientCertificate(Certificate clientCertificate)
                                        throws java.io.IOException

      Specified by:
        `processClientCertificate` in interface `TlsKeyExchange`
      Overrides:
        `processClientCertificate` in class `AbstractTlsKeyExchange`
      Throws:
        `java.io.IOException`

    - #### processClientKeyExchange

          public void processClientKeyExchange(java.io.InputStream input)
                                        throws java.io.IOException

      Specified by:
        `processClientKeyExchange` in interface `TlsKeyExchange`
      Overrides:
        `processClientKeyExchange` in class `AbstractTlsKeyExchange`
      Throws:
        `java.io.IOException`

    - #### generatePremasterSecret

          public byte[] generatePremasterSecret()
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getMinimumPrimeBits

          protected int getMinimumPrimeBits()

    - #### validateDHParameters

          protected DHParameters validateDHParameters(DHParameters params)
                                               throws java.io.IOException

      Throws:
        `java.io.IOException`