public class JceTlsDHDomain extends java.lang.Object implements TlsDHDomain
Modifier and Type | Field and Description |
---|---|
protected JcaTlsCrypto |
crypto |
protected TlsDHConfig |
dhConfig |
protected javax.crypto.spec.DHParameterSpec |
dhDomain |
Constructor and Description |
---|
JceTlsDHDomain(JcaTlsCrypto crypto,
TlsDHConfig dhConfig) |
Modifier and Type | Method and Description |
---|---|
byte[] |
calculateDHAgreement(javax.crypto.interfaces.DHPublicKey publicKey,
javax.crypto.interfaces.DHPrivateKey privateKey) |
TlsAgreement |
createDH()
Return an agreement operator suitable for ephemeral Diffie-Hellman.
|
static java.math.BigInteger |
decodeParameter(byte[] encoding) |
javax.crypto.interfaces.DHPublicKey |
decodePublicKey(byte[] encoding) |
byte[] |
encodeParameter(java.math.BigInteger x) |
byte[] |
encodePublicKey(javax.crypto.interfaces.DHPublicKey publicKey) |
java.security.KeyPair |
generateKeyPair() |
JcaTlsCrypto |
getCrypto() |
javax.crypto.spec.DHParameterSpec |
getParameters(TlsDHConfig dhConfig) |
protected JcaTlsCrypto crypto
protected TlsDHConfig dhConfig
protected javax.crypto.spec.DHParameterSpec dhDomain
public JceTlsDHDomain(JcaTlsCrypto crypto, TlsDHConfig dhConfig)
public byte[] calculateDHAgreement(javax.crypto.interfaces.DHPublicKey publicKey, javax.crypto.interfaces.DHPrivateKey privateKey) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public TlsAgreement createDH()
TlsDHDomain
createDH
in interface TlsDHDomain
public static java.math.BigInteger decodeParameter(byte[] encoding) throws java.io.IOException
java.io.IOException
public javax.crypto.interfaces.DHPublicKey decodePublicKey(byte[] encoding) throws java.io.IOException
java.io.IOException
public byte[] encodeParameter(java.math.BigInteger x) throws java.io.IOException
java.io.IOException
public byte[] encodePublicKey(javax.crypto.interfaces.DHPublicKey publicKey) throws java.io.IOException
java.io.IOException
public java.security.KeyPair generateKeyPair()
public JcaTlsCrypto getCrypto()
public javax.crypto.spec.DHParameterSpec getParameters(TlsDHConfig dhConfig)