Top Description Fields Constructors Methods
org.bouncycastle.tls.crypto.impl.bc

public Class BcTlsDHDomain

extends Object
implements TlsDHDomain
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsDHDomain
Imports
java.io.IOException, java.math.BigInteger, org.bouncycastle.crypto.AsymmetricCipherKeyPair, org.bouncycastle.crypto.agreement.DHBasicAgreement, org.bouncycastle.crypto.generators.DHBasicKeyPairGenerator, org.bouncycastle.crypto.params.DHKeyGenerationParameters, .DHParameters, .DHPrivateKeyParameters, .DHPublicKeyParameters, org.bouncycastle.tls.AlertDescription, .TlsDHUtils, .TlsFatalAlert, org.bouncycastle.tls.crypto.DHGroup, .TlsAgreement, .TlsDHConfig, .TlsDHDomain, org.bouncycastle.util.BigIntegers

BC light-weight support class for Diffie-Hellman key pair generation and key agreement over a specified Diffie-Hellman configuration.

Field Summary

Modifier and TypeField and Description
protected TlsDHConfig
protected BcTlsCrypto
protected DHParameters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static BcTlsSecret
calculateDHAgreement(BcTlsCrypto crypto, DHPrivateKeyParameters privateKey, DHPublicKeyParameters publicKey, boolean padded)

public BcTlsSecret
public TlsAgreement
createDH()

Implements org.bouncycastle.tls.crypto.TlsDHDomain.createDH.

Return an agreement operator suitable for ephemeral Diffie-Hellman.

public BigInteger
decodeParameter(byte[] encoding)

public DHPublicKeyParameters
decodePublicKey(byte[] encoding)

public byte[]
public byte[]
private static byte[]
encodeValue(DHParameters dh, boolean padded, BigInteger x)

public AsymmetricCipherKeyPair
public static DHParameters
private static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configback to summary
protected TlsDHConfig config
cryptoback to summary
protected BcTlsCrypto crypto
domainParametersback to summary
protected DHParameters domainParameters

Constructor Detail

BcTlsDHDomainback to summary
public BcTlsDHDomain(BcTlsCrypto crypto, TlsDHConfig dhConfig)

Method Detail

calculateDHAgreementback to summary
public static BcTlsSecret calculateDHAgreement(BcTlsCrypto crypto, DHPrivateKeyParameters privateKey, DHPublicKeyParameters publicKey, boolean padded)
calculateDHAgreementback to summary
public BcTlsSecret calculateDHAgreement(DHPrivateKeyParameters privateKey, DHPublicKeyParameters publicKey)
createDHback to summary
public TlsAgreement createDH()

Implements org.bouncycastle.tls.crypto.TlsDHDomain.createDH.

Doc from org.bouncycastle.tls.crypto.TlsDHDomain.createDH.

Return an agreement operator suitable for ephemeral Diffie-Hellman.

Returns:TlsAgreement

a key agreement operator.

decodeParameterback to summary
public BigInteger decodeParameter(byte[] encoding) throws IOException
decodePublicKeyback to summary
public DHPublicKeyParameters decodePublicKey(byte[] encoding) throws IOException
encodeParameterback to summary
public byte[] encodeParameter(BigInteger x)
encodePublicKeyback to summary
public byte[] encodePublicKey(DHPublicKeyParameters publicKey)
encodeValueback to summary
private static byte[] encodeValue(DHParameters dh, boolean padded, BigInteger x)
generateKeyPairback to summary
public AsymmetricCipherKeyPair generateKeyPair()
getDomainParametersback to summary
public static DHParameters getDomainParameters(TlsDHConfig dhConfig)
getValueLengthback to summary
private static int getValueLength(DHParameters dh)