Package org.conscrypt
Class ServerKeyExchange
java.lang.Object
org.conscrypt.Message
org.conscrypt.ServerKeyExchange
public class ServerKeyExchange extends Message
Represents server key exchange message.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ServerKeyExchange(BigInteger par1, BigInteger par2, BigInteger par3, byte[] hash)Creates outbound messageServerKeyExchange(HandshakeIODataStream in, int length, int keyExchange)Creates inbound message -
Method Summary
Modifier and Type Method Description RSAPublicKeygetRSAPublicKey()Returns RSAPublicKey generated using ServerRSAParams (rsa_modulus and rsa_exponent).intgetType()Returns message typebooleanisAnonymous()Will returntrueif the signature isnullsince this is considered anonymous.voidsend(HandshakeIODataStream out)Sends messagestatic byte[]toUnsignedByteArray(BigInteger bi)Remove first byte if 0.static voidupdateSignatureDh(DigitalSignature ds, BigInteger p, BigInteger g, BigInteger y)static voidupdateSignatureRsa(DigitalSignature ds, BigInteger modulus, BigInteger publicExponent)booleanverifySignature(DigitalSignature ds)Methods inherited from class org.conscrypt.Message
fatalAlert, fatalAlert, length
-
Constructor Details
-
ServerKeyExchange
Creates outbound message- Parameters:
par1- rsa_modulus or dh_ppar2- rsa_exponent or dh_gpar3- dh_Ys for ServerDHParams; should be null for ServerRSAParamshash- should be null for anonymous SignatureAlgorithm
-
ServerKeyExchange
Creates inbound message- Parameters:
in-length-keyExchange-- Throws:
IOException
-
-
Method Details
-
toUnsignedByteArray
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
-
isAnonymous
public boolean isAnonymous()Will returntrueif the signature isnullsince this is considered anonymous. -
send
Sends message- Parameters:
out-
-
getRSAPublicKey
Returns RSAPublicKey generated using ServerRSAParams (rsa_modulus and rsa_exponent).- Returns:
-
getType
public int getType()Returns message type- Returns:
-