Package org.conscrypt

Class ServerKeyExchange

java.lang.Object
org.conscrypt.Message
org.conscrypt.ServerKeyExchange

public class ServerKeyExchange
extends Message
Represents server key exchange message.
See Also:
TLS 1.0 spec., 7.4.3. Server key exchange message.
  • Constructor Details

    • ServerKeyExchange

      public ServerKeyExchange​(BigInteger par1, BigInteger par2, BigInteger par3, byte[] hash)
      Creates outbound message
      Parameters:
      par1 - rsa_modulus or dh_p
      par2 - rsa_exponent or dh_g
      par3 - dh_Ys for ServerDHParams; should be null for ServerRSAParams
      hash - should be null for anonymous SignatureAlgorithm
    • ServerKeyExchange

      public ServerKeyExchange​(HandshakeIODataStream in, int length, int keyExchange) throws IOException
      Creates inbound message
      Parameters:
      in -
      length -
      keyExchange -
      Throws:
      IOException
  • Method Details

    • toUnsignedByteArray

      public static byte[] toUnsignedByteArray​(BigInteger bi)
      Remove first byte if 0. Needed because BigInteger.toByteArray() sometimes returns a zero prefix.
    • updateSignatureRsa

      public static void updateSignatureRsa​(DigitalSignature ds, BigInteger modulus, BigInteger publicExponent)
    • updateSignatureDh

      public static void updateSignatureDh​(DigitalSignature ds, BigInteger p, BigInteger g, BigInteger y)
    • verifySignature

      public boolean verifySignature​(DigitalSignature ds)
    • isAnonymous

      public boolean isAnonymous()
      Will return true if the signature is null since this is considered anonymous.
    • send

      public void send​(HandshakeIODataStream out)
      Sends message
      Parameters:
      out -
    • getRSAPublicKey

      public RSAPublicKey getRSAPublicKey()
      Returns RSAPublicKey generated using ServerRSAParams (rsa_modulus and rsa_exponent).
      Returns:
    • getType

      public int getType()
      Returns message type
      Returns: