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 |
dhSpec |
Constructor and Description |
---|
JceTlsDHDomain(JcaTlsCrypto crypto,
TlsDHConfig dhConfig) |
Modifier and Type | Method and Description |
---|---|
JceTlsSecret |
calculateDHAgreement(javax.crypto.interfaces.DHPrivateKey privateKey,
javax.crypto.interfaces.DHPublicKey publicKey) |
static JceTlsSecret |
calculateDHAgreement(JcaTlsCrypto crypto,
javax.crypto.interfaces.DHPrivateKey privateKey,
javax.crypto.interfaces.DHPublicKey publicKey,
boolean padded) |
TlsAgreement |
createDH()
Return an agreement operator suitable for ephemeral Diffie-Hellman.
|
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() |
protected final JcaTlsCrypto crypto
protected final TlsDHConfig dhConfig
protected final javax.crypto.spec.DHParameterSpec dhSpec
public JceTlsDHDomain(JcaTlsCrypto crypto, TlsDHConfig dhConfig)
public static JceTlsSecret calculateDHAgreement(JcaTlsCrypto crypto, javax.crypto.interfaces.DHPrivateKey privateKey, javax.crypto.interfaces.DHPublicKey publicKey, boolean padded) throws java.io.IOException
java.io.IOException
public JceTlsSecret calculateDHAgreement(javax.crypto.interfaces.DHPrivateKey privateKey, javax.crypto.interfaces.DHPublicKey publicKey) throws java.io.IOException
java.io.IOException
public TlsAgreement createDH()
TlsDHDomain
createDH
in interface TlsDHDomain
public 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() throws java.io.IOException
java.io.IOException