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

public Class JceTlsDHDomain

extends Object
implements TlsDHDomain
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsDHDomain
Imports
java.io.IOException, java.math.BigInteger, java.security.GeneralSecurityException, .KeyFactory, .KeyPair, .KeyPairGenerator, java.security.spec.KeySpec, java.util.Arrays, javax.crypto.interfaces.DHPrivateKey, .DHPublicKey, javax.crypto.spec.DHParameterSpec, org.bouncycastle.tls.AlertDescription, .TlsDHUtils, .TlsFatalAlert, org.bouncycastle.tls.crypto.DHGroup, .TlsAgreement, .TlsCryptoException, .TlsDHConfig, .TlsDHDomain, org.bouncycastle.util.BigIntegers

JCE 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 final JcaTlsCrypto
protected final TlsDHConfig
protected final DHParameterSpec

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static JceTlsSecret
calculateDHAgreement(JcaTlsCrypto crypto, DHPrivateKey privateKey, DHPublicKey publicKey, boolean padded)

public JceTlsSecret
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 DHPublicKey
decodePublicKey(byte[] encoding)

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

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

Field Detail

cryptoback to summary
protected final JcaTlsCrypto crypto
dhConfigback to summary
protected final TlsDHConfig dhConfig
dhSpecback to summary
protected final DHParameterSpec dhSpec

Constructor Detail

JceTlsDHDomainback to summary
public JceTlsDHDomain(JcaTlsCrypto crypto, TlsDHConfig dhConfig)

Method Detail

calculateDHAgreementback to summary
public static JceTlsSecret calculateDHAgreement(JcaTlsCrypto crypto, DHPrivateKey privateKey, DHPublicKey publicKey, boolean padded) throws IOException
calculateDHAgreementback to summary
public JceTlsSecret calculateDHAgreement(DHPrivateKey privateKey, DHPublicKey publicKey) throws IOException
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 DHPublicKey decodePublicKey(byte[] encoding) throws IOException
encodeParameterback to summary
public byte[] encodeParameter(BigInteger x) throws IOException
encodePublicKeyback to summary
public byte[] encodePublicKey(DHPublicKey publicKey) throws IOException
encodeValueback to summary
private static byte[] encodeValue(DHParameterSpec dh, boolean padded, BigInteger x)
generateKeyPairback to summary
public KeyPair generateKeyPair() throws IOException
getValueLengthback to summary
private static int getValueLength(DHParameterSpec dh)