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

org.bouncycastle.crypto.tls

## Class TlsDHUtils

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

-     public class TlsDHUtils
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.Integer` | `EXT_negotiated_ff_dhe_groups`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TlsDHUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addNegotiatedDHEGroupsClientExtension(java.util.Hashtable extensions, short[] dheGroups)`
    `static void` | `addNegotiatedDHEGroupsServerExtension(java.util.Hashtable extensions, short dheGroup)`
    `static boolean` | `areCompatibleParameters(DHParameters a, DHParameters b)`
    `static byte[]` | `calculateDHBasicAgreement(DHPublicKeyParameters publicKey, DHPrivateKeyParameters privateKey)`
    `static boolean` | `containsDHECipherSuites(int[] cipherSuites)`
    `static byte[]` | `createNegotiatedDHEGroupsClientExtension(short[] dheGroups)`
    `static byte[]` | `createNegotiatedDHEGroupsServerExtension(short dheGroup)`
    `static AsymmetricCipherKeyPair` | `generateDHKeyPair(java.security.SecureRandom random, DHParameters dhParams)`
    `static DHPrivateKeyParameters` | `generateEphemeralClientKeyExchange(java.security.SecureRandom random, DHParameters dhParams, java.io.OutputStream output)`
    `static DHPrivateKeyParameters` | `generateEphemeralServerKeyExchange(java.security.SecureRandom random, DHParameters dhParams, java.io.OutputStream output)`
    `static short[]` | `getNegotiatedDHEGroupsClientExtension(java.util.Hashtable extensions)`
    `static short` | `getNegotiatedDHEGroupsServerExtension(java.util.Hashtable extensions)`
    `static DHParameters` | `getParametersForDHEGroup(short dheGroup)`
    `static boolean` | `isDHECipherSuite(int cipherSuite)`
    `static java.math.BigInteger` | `readDHParameter(java.io.InputStream input)`
    `static short[]` | `readNegotiatedDHEGroupsClientExtension(byte[] extensionData)`
    `static short` | `readNegotiatedDHEGroupsServerExtension(byte[] extensionData)`
    `static DHPublicKeyParameters` | `validateDHPublicKey(DHPublicKeyParameters key)`
    `static void` | `writeDHParameter(java.math.BigInteger x, java.io.OutputStream output)`

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

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

- - ### Field Detail

    - #### EXT_negotiated_ff_dhe_groups

          public static final java.lang.Integer EXT_negotiated_ff_dhe_groups

  - ### Constructor Detail

    - #### TlsDHUtils

          public TlsDHUtils()

  - ### Method Detail

    - #### addNegotiatedDHEGroupsClientExtension

          public static void addNegotiatedDHEGroupsClientExtension(java.util.Hashtable extensions,
                                                   short[] dheGroups)
                                                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### addNegotiatedDHEGroupsServerExtension

          public static void addNegotiatedDHEGroupsServerExtension(java.util.Hashtable extensions,
                                                   short dheGroup)
                                                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getNegotiatedDHEGroupsClientExtension

          public static short[] getNegotiatedDHEGroupsClientExtension(java.util.Hashtable extensions)
                                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getNegotiatedDHEGroupsServerExtension

          public static short getNegotiatedDHEGroupsServerExtension(java.util.Hashtable extensions)
                                                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### createNegotiatedDHEGroupsClientExtension

          public static byte[] createNegotiatedDHEGroupsClientExtension(short[] dheGroups)
                                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### createNegotiatedDHEGroupsServerExtension

          public static byte[] createNegotiatedDHEGroupsServerExtension(short dheGroup)
                                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readNegotiatedDHEGroupsClientExtension

          public static short[] readNegotiatedDHEGroupsClientExtension(byte[] extensionData)
                                                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readNegotiatedDHEGroupsServerExtension

          public static short readNegotiatedDHEGroupsServerExtension(byte[] extensionData)
                                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getParametersForDHEGroup

          public static DHParameters getParametersForDHEGroup(short dheGroup)

    - #### containsDHECipherSuites

          public static boolean containsDHECipherSuites(int[] cipherSuites)

    - #### isDHECipherSuite

          public static boolean isDHECipherSuite(int cipherSuite)

    - #### areCompatibleParameters

          public static boolean areCompatibleParameters(DHParameters a,
                                        DHParameters b)

    - #### calculateDHBasicAgreement

          public static byte[] calculateDHBasicAgreement(DHPublicKeyParameters publicKey,
                                         DHPrivateKeyParameters privateKey)

    - #### generateDHKeyPair

          public static AsymmetricCipherKeyPair generateDHKeyPair(java.security.SecureRandom random,
                                                  DHParameters dhParams)

    - #### generateEphemeralClientKeyExchange

          public static DHPrivateKeyParameters generateEphemeralClientKeyExchange(java.security.SecureRandom random,
                                                                  DHParameters dhParams,
                                                                  java.io.OutputStream output)
                                                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### generateEphemeralServerKeyExchange

          public static DHPrivateKeyParameters generateEphemeralServerKeyExchange(java.security.SecureRandom random,
                                                                  DHParameters dhParams,
                                                                  java.io.OutputStream output)
                                                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### validateDHPublicKey

          public static DHPublicKeyParameters validateDHPublicKey(DHPublicKeyParameters key)
                                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readDHParameter

          public static java.math.BigInteger readDHParameter(java.io.InputStream input)
                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeDHParameter

          public static void writeDHParameter(java.math.BigInteger x,
                              java.io.OutputStream output)
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`