Class BcTlsDHDomain
java.lang.Object
org.bouncycastle.tls.crypto.impl.bc.BcTlsDHDomain
- All Implemented Interfaces:
TlsDHDomain
BC light-weight support class for Diffie-Hellman key pair generation and key agreement over a specified Diffie-Hellman configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TlsDHConfig
protected BcTlsCrypto
protected org.bouncycastle.crypto.params.DHParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateDHAgreement
(org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey) static BcTlsSecret
calculateDHAgreement
(BcTlsCrypto crypto, org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey, boolean padded) createDH()
Return an agreement operator suitable for ephemeral Diffie-Hellman.decodeParameter
(byte[] encoding) org.bouncycastle.crypto.params.DHPublicKeyParameters
decodePublicKey
(byte[] encoding) byte[]
byte[]
encodePublicKey
(org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey) org.bouncycastle.crypto.AsymmetricCipherKeyPair
static org.bouncycastle.crypto.params.DHParameters
getDomainParameters
(TlsDHConfig dhConfig)
-
Field Details
-
crypto
-
config
-
domainParameters
protected org.bouncycastle.crypto.params.DHParameters domainParameters
-
-
Constructor Details
-
BcTlsDHDomain
-
-
Method Details
-
calculateDHAgreement
public static BcTlsSecret calculateDHAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey, boolean padded) -
getDomainParameters
-
calculateDHAgreement
public BcTlsSecret calculateDHAgreement(org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey) -
createDH
Description copied from interface:TlsDHDomain
Return an agreement operator suitable for ephemeral Diffie-Hellman.- Specified by:
createDH
in interfaceTlsDHDomain
- Returns:
- a key agreement operator.
-
decodeParameter
- Throws:
IOException
-
decodePublicKey
public org.bouncycastle.crypto.params.DHPublicKeyParameters decodePublicKey(byte[] encoding) throws IOException - Throws:
IOException
-
encodeParameter
-
encodePublicKey
public byte[] encodePublicKey(org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey) -
generateKeyPair
public org.bouncycastle.crypto.AsymmetricCipherKeyPair generateKeyPair()
-