public class ECDH
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ECDH.Curves |
Modifier and Type | Field and Description |
---|---|
ECDH.Curves |
curve |
Constructor and Description |
---|
ECDH(ECDH.Curves curve)
Initialize the ECDH Exchange: this will draw some entropy
|
Modifier and Type | Method and Description |
---|---|
static void |
blockingInit()
Initialize the key pair generators, which in turn will create the
global SecureRandom, which may block waiting for entropy from
/dev/random on unix-like systems.
|
byte[] |
getAgreedSecret(java.security.interfaces.ECPublicKey pubkey)
Completes the ECDH exchange: this is CPU intensive
|
java.security.interfaces.ECPublicKey |
getPublicKey() |
static java.security.interfaces.ECPublicKey |
getPublicKey(byte[] data,
ECDH.Curves curve)
Returns an ECPublicKey from bytes obtained using ECPublicKey.getEncoded()
|
byte[] |
getPublicKeyNetworkFormat()
Return the public key as a byte[] in network format
|
public final ECDH.Curves curve
public ECDH(ECDH.Curves curve)
curve
- public byte[] getAgreedSecret(java.security.interfaces.ECPublicKey pubkey)
pubkey
- public java.security.interfaces.ECPublicKey getPublicKey()
public static java.security.interfaces.ECPublicKey getPublicKey(byte[] data, ECDH.Curves curve)
data
- public static void blockingInit()
public byte[] getPublicKeyNetworkFormat()