public class ECDHPeer extends KeyAgreementPeer
KeyAgreementPeer implementation that uses the Elliptic Curve Diffie-Hellman key agreement protocol.
| Constructor and Description |
|---|
ECDHPeer(java.security.spec.AlgorithmParameterSpec spec)
Constructs a
ECDHPeer instance using an elliptic curve AlgorithmParameterSpec. |
ECDHPeer(java.security.spec.AlgorithmParameterSpec spec,
java.security.KeyPair keyPair)
Constructs a
ECDHPeer instance using an elliptic curve AlgorithmParameterSpec. |
ECDHPeer(java.security.spec.AlgorithmParameterSpec spec,
java.security.KeyPair keyPair,
java.lang.String provider)
Constructs a
ECDHPeer instance using an elliptic curve AlgorithmParameterSpec and a custom provider. |
ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h)
Constructs a
ECDHPeer instance using a custom elliptic curve. |
ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h,
java.security.KeyPair keyPair)
Constructs a
ECDHPeer instance using a custom elliptic curve. |
ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h,
java.security.KeyPair keyPair,
java.lang.String provider)
Constructs a
ECDHPeer instance using a custom elliptic curve. |
ECDHPeer(java.lang.String curve)
Constructs a
ECDHPeer instance using a named elliptic curve curve. |
ECDHPeer(java.lang.String curve,
java.security.KeyPair keyPair)
Constructs a
ECDHPeer instance using a named elliptic curve curve. |
| Modifier and Type | Method and Description |
|---|---|
static java.security.KeyPair |
createKeyPair(java.security.spec.AlgorithmParameterSpec spec)
Creates and returns an ECDH key pair for the given parameter specification.
|
static java.security.KeyPair |
createKeyPair(java.security.spec.AlgorithmParameterSpec spec,
java.security.Provider provider)
Creates and returns an ECDH key pair for the given parameter specification and provider.
|
static java.security.KeyPair |
createKeyPair(java.security.spec.AlgorithmParameterSpec spec,
java.lang.String provider)
Creates and returns an ECDH key pair for the given parameter specification and provider.
|
java.security.spec.AlgorithmParameterSpec |
getAlgorithmParameterSpec()
Returns the inner
AlgorithmParameterSpec. |
computeSharedSecret, getKeyAgreement, getPublicKeypublic ECDHPeer(java.lang.String curve)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using a named elliptic curve curve.
Note: This constructor will use Bouncy Castle (BC) as its provider.
curve - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.lang.String curve,
java.security.KeyPair keyPair)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using a named elliptic curve curve.
Note: This constructor will use Bouncy Castle (BC) as its provider.
curve - keyPair - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using a custom elliptic curve.
p - a - b - xg - yg - n - h - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h,
java.security.KeyPair keyPair)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using a custom elliptic curve.
p - a - b - xg - yg - n - h - keyPair - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.math.BigInteger p,
java.math.BigInteger a,
java.math.BigInteger b,
java.math.BigInteger xg,
java.math.BigInteger yg,
java.math.BigInteger n,
int h,
java.security.KeyPair keyPair,
java.lang.String provider)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using a custom elliptic curve.
p - a - b - xg - yg - n - h - keyPair - provider - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.security.spec.AlgorithmParameterSpec spec)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using an elliptic curve AlgorithmParameterSpec.
spec - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.security.spec.AlgorithmParameterSpec spec,
java.security.KeyPair keyPair)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using an elliptic curve AlgorithmParameterSpec.
spec - keyPair - java.security.GeneralSecurityExceptionpublic ECDHPeer(java.security.spec.AlgorithmParameterSpec spec,
java.security.KeyPair keyPair,
java.lang.String provider)
throws java.security.GeneralSecurityException
Constructs a ECDHPeer instance using an elliptic curve AlgorithmParameterSpec and a custom provider.
spec - keyPair - provider - java.security.GeneralSecurityExceptionpublic java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec()
Returns the inner AlgorithmParameterSpec.
public static final java.security.KeyPair createKeyPair(java.security.spec.AlgorithmParameterSpec spec)
throws java.security.GeneralSecurityException
Creates and returns an ECDH key pair for the given parameter specification.
spec - java.security.GeneralSecurityExceptionpublic static final java.security.KeyPair createKeyPair(java.security.spec.AlgorithmParameterSpec spec,
java.lang.String provider)
throws java.security.GeneralSecurityException
Creates and returns an ECDH key pair for the given parameter specification and provider.
spec - provider - java.security.GeneralSecurityExceptionpublic static final java.security.KeyPair createKeyPair(java.security.spec.AlgorithmParameterSpec spec,
java.security.Provider provider)
throws java.security.GeneralSecurityException
Creates and returns an ECDH key pair for the given parameter specification and provider.
spec - provider - java.security.GeneralSecurityException