Class BcTlsECDomain
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.bc.BcTlsECDomain
-
- All Implemented Interfaces:
TlsECDomain
public class BcTlsECDomain extends java.lang.Object implements TlsECDomain
EC domain class for generating key pairs and performing key agreement.
-
-
Field Summary
Fields Modifier and Type Field Description protected BcTlsCrypto
crypto
protected TlsECConfig
ecConfig
protected org.bouncycastle.crypto.params.ECDomainParameters
ecDomainParameters
-
Constructor Summary
Constructors Constructor Description BcTlsECDomain(BcTlsCrypto crypto, TlsECConfig ecConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BcTlsSecret
calculateBasicAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.ECPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey)
BcTlsSecret
calculateECDHAgreement(org.bouncycastle.crypto.params.ECPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey)
TlsAgreement
createECDH()
Return an agreement operator suitable for ephemeral EC Diffie-Hellman.org.bouncycastle.math.ec.ECPoint
decodePoint(byte[] encoding)
org.bouncycastle.crypto.params.ECPublicKeyParameters
decodePublicKey(byte[] encoding)
byte[]
encodePoint(org.bouncycastle.math.ec.ECPoint point)
byte[]
encodePublicKey(org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey)
org.bouncycastle.crypto.AsymmetricCipherKeyPair
generateKeyPair()
static org.bouncycastle.crypto.params.ECDomainParameters
getDomainParameters(int namedGroup)
static org.bouncycastle.crypto.params.ECDomainParameters
getDomainParameters(TlsECConfig ecConfig)
-
-
-
Field Detail
-
crypto
protected final BcTlsCrypto crypto
-
ecConfig
protected final TlsECConfig ecConfig
-
ecDomainParameters
protected final org.bouncycastle.crypto.params.ECDomainParameters ecDomainParameters
-
-
Constructor Detail
-
BcTlsECDomain
public BcTlsECDomain(BcTlsCrypto crypto, TlsECConfig ecConfig)
-
-
Method Detail
-
calculateBasicAgreement
public static BcTlsSecret calculateBasicAgreement(BcTlsCrypto crypto, org.bouncycastle.crypto.params.ECPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey)
-
getDomainParameters
public static org.bouncycastle.crypto.params.ECDomainParameters getDomainParameters(TlsECConfig ecConfig)
-
getDomainParameters
public static org.bouncycastle.crypto.params.ECDomainParameters getDomainParameters(int namedGroup)
-
calculateECDHAgreement
public BcTlsSecret calculateECDHAgreement(org.bouncycastle.crypto.params.ECPrivateKeyParameters privateKey, org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey)
-
createECDH
public TlsAgreement createECDH()
Description copied from interface:TlsECDomain
Return an agreement operator suitable for ephemeral EC Diffie-Hellman.- Specified by:
createECDH
in interfaceTlsECDomain
- Returns:
- a key agreement operator.
-
decodePoint
public org.bouncycastle.math.ec.ECPoint decodePoint(byte[] encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
decodePublicKey
public org.bouncycastle.crypto.params.ECPublicKeyParameters decodePublicKey(byte[] encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
encodePoint
public byte[] encodePoint(org.bouncycastle.math.ec.ECPoint point) throws java.io.IOException
- Throws:
java.io.IOException
-
encodePublicKey
public byte[] encodePublicKey(org.bouncycastle.crypto.params.ECPublicKeyParameters publicKey) throws java.io.IOException
- Throws:
java.io.IOException
-
generateKeyPair
public org.bouncycastle.crypto.AsymmetricCipherKeyPair generateKeyPair()
-
-