Class BcTlsDHDomain
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.BcTlsDHDomain
-
- All Implemented Interfaces:
TlsDHDomain
public class BcTlsDHDomain extends java.lang.Object implements TlsDHDomain
BC light-weight support class for Diffie-Hellman key pair generation and key agreement over a specified Diffie-Hellman configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected BcTlsCryptocryptoprotected TlsDHConfigdhConfigprotected org.bouncycastle.crypto.params.DHParametersdhParameters
-
Constructor Summary
Constructors Constructor Description BcTlsDHDomain(BcTlsCrypto crypto, TlsDHConfig dhConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BcTlsSecretcalculateDHAgreement(org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey)static BcTlsSecretcalculateDHAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey, boolean padded)TlsAgreementcreateDH()Return an agreement operator suitable for ephemeral Diffie-Hellman.java.math.BigIntegerdecodeParameter(byte[] encoding)org.bouncycastle.crypto.params.DHPublicKeyParametersdecodePublicKey(byte[] encoding)byte[]encodeParameter(java.math.BigInteger x)byte[]encodePublicKey(org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey)org.bouncycastle.crypto.AsymmetricCipherKeyPairgenerateKeyPair()static org.bouncycastle.crypto.params.DHParametersgetParameters(TlsDHConfig dhConfig)
-
-
-
Field Detail
-
crypto
protected BcTlsCrypto crypto
-
dhConfig
protected TlsDHConfig dhConfig
-
dhParameters
protected org.bouncycastle.crypto.params.DHParameters dhParameters
-
-
Constructor Detail
-
BcTlsDHDomain
public BcTlsDHDomain(BcTlsCrypto crypto, TlsDHConfig dhConfig)
-
-
Method Detail
-
calculateDHAgreement
public static BcTlsSecret calculateDHAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey, boolean padded)
-
getParameters
public static org.bouncycastle.crypto.params.DHParameters getParameters(TlsDHConfig dhConfig)
-
calculateDHAgreement
public BcTlsSecret calculateDHAgreement(org.bouncycastle.crypto.params.DHPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey)
-
createDH
public TlsAgreement createDH()
Description copied from interface:TlsDHDomainReturn an agreement operator suitable for ephemeral Diffie-Hellman.- Specified by:
createDHin interfaceTlsDHDomain- Returns:
- a key agreement operator.
-
decodeParameter
public java.math.BigInteger decodeParameter(byte[] encoding) throws java.io.IOException- Throws:
java.io.IOException
-
decodePublicKey
public org.bouncycastle.crypto.params.DHPublicKeyParameters decodePublicKey(byte[] encoding) throws java.io.IOException- Throws:
java.io.IOException
-
encodeParameter
public byte[] encodeParameter(java.math.BigInteger x) throws java.io.IOException- Throws:
java.io.IOException
-
encodePublicKey
public byte[] encodePublicKey(org.bouncycastle.crypto.params.DHPublicKeyParameters publicKey) throws java.io.IOException- Throws:
java.io.IOException
-
generateKeyPair
public org.bouncycastle.crypto.AsymmetricCipherKeyPair generateKeyPair()
-
-