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

org.bouncycastle.crypto.tls

## Class TlsPSKKeyExchange

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

- All Implemented Interfaces:
    TlsKeyExchange

      public class TlsPSKKeyExchange
      extends AbstractTlsKeyExchange

  (D)TLS PSK key exchange (RFC 4279).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected short[]` | `clientECPointFormats`
    `protected DHPrivateKeyParameters` | `dhAgreePrivateKey`
    `protected DHPublicKeyParameters` | `dhAgreePublicKey`
    `protected DHParameters` | `dhParameters`
    `protected ECPrivateKeyParameters` | `ecAgreePrivateKey`
    `protected ECPublicKeyParameters` | `ecAgreePublicKey`
    `protected int[]` | `namedCurves`
    `protected byte[]` | `premasterSecret`
    `protected byte[]` | `psk`
    `protected byte[]` | `psk_identity_hint`
    `protected TlsPSKIdentity` | `pskIdentity`
    `protected TlsPSKIdentityManager` | `pskIdentityManager`
    `protected RSAKeyParameters` | `rsaServerPublicKey`
    `protected TlsEncryptionCredentials` | `serverCredentials`
    `protected short[]` | `serverECPointFormats`
    `protected AsymmetricKeyParameter` | `serverPublicKey`

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

      `context, keyExchange, supportedSignatureAlgorithms`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TlsPSKKeyExchange(int keyExchange, java.util.Vector supportedSignatureAlgorithms, TlsPSKIdentity pskIdentity, TlsPSKIdentityManager pskIdentityManager, DHParameters dhParameters, int[] namedCurves, short[] clientECPointFormats, short[] serverECPointFormats)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `generateClientKeyExchange(java.io.OutputStream output)`
    `protected byte[]` | `generateOtherSecret(int pskLength)`
    `byte[]` | `generatePremasterSecret()`
    `byte[]` | `generateServerKeyExchange()`
    `void` | `processClientCredentials(TlsCredentials clientCredentials)`
    `void` | `processClientKeyExchange(java.io.InputStream input)`
    `void` | `processServerCertificate(Certificate serverCertificate)`
    `void` | `processServerCredentials(TlsCredentials serverCredentials)`
    `void` | `processServerKeyExchange(java.io.InputStream input)`
    `boolean` | `requiresServerKeyExchange()`
    `void` | `skipServerCredentials()`
    `void` | `validateCertificateRequest(CertificateRequest certificateRequest)`
    `protected RSAKeyParameters` | `validateRSAPublicKey(RSAKeyParameters key)`

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

      `init, parseSignature, processClientCertificate, skipClientCredentials, skipServerKeyExchange`

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

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

- - ### Field Detail

    - #### pskIdentity

          protected TlsPSKIdentity pskIdentity

    - #### pskIdentityManager

          protected TlsPSKIdentityManager pskIdentityManager

    - #### dhParameters

          protected DHParameters dhParameters

    - #### namedCurves

          protected int[] namedCurves

    - #### clientECPointFormats

          protected short[] clientECPointFormats

    - #### serverECPointFormats

          protected short[] serverECPointFormats

    - #### psk_identity_hint

          protected byte[] psk_identity_hint

    - #### psk

          protected byte[] psk

    - #### dhAgreePrivateKey

          protected DHPrivateKeyParameters dhAgreePrivateKey

    - #### dhAgreePublicKey

          protected DHPublicKeyParameters dhAgreePublicKey

    - #### ecAgreePrivateKey

          protected ECPrivateKeyParameters ecAgreePrivateKey

    - #### ecAgreePublicKey

          protected ECPublicKeyParameters ecAgreePublicKey

    - #### serverPublicKey

          protected AsymmetricKeyParameter serverPublicKey

    - #### rsaServerPublicKey

          protected RSAKeyParameters rsaServerPublicKey

    - #### serverCredentials

          protected TlsEncryptionCredentials serverCredentials

    - #### premasterSecret

          protected byte[] premasterSecret

  - ### Constructor Detail

    - #### TlsPSKKeyExchange

          public TlsPSKKeyExchange(int keyExchange,
                           java.util.Vector supportedSignatureAlgorithms,
                           TlsPSKIdentity pskIdentity,
                           TlsPSKIdentityManager pskIdentityManager,
                           DHParameters dhParameters,
                           int[] namedCurves,
                           short[] clientECPointFormats,
                           short[] serverECPointFormats)

  - ### Method Detail

    - #### skipServerCredentials

          public void skipServerCredentials()
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### processServerCredentials

          public void processServerCredentials(TlsCredentials serverCredentials)
                                        throws java.io.IOException

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

    - #### generateServerKeyExchange

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

      Specified by:
        `generateServerKeyExchange` in interface `TlsKeyExchange`
      Overrides:
        `generateServerKeyExchange` in class `AbstractTlsKeyExchange`
      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`

    - #### processServerKeyExchange

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

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

    - #### 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`

    - #### 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`

    - #### generateOtherSecret

          protected byte[] generateOtherSecret(int pskLength)
                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### validateRSAPublicKey

          protected RSAKeyParameters validateRSAPublicKey(RSAKeyParameters key)
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`