public class ECDSA
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ECDSA.Curves |
Modifier and Type | Field and Description |
---|---|
ECDSA.Curves |
curve |
Constructor and Description |
---|
ECDSA(ECDSA.Curves curve)
Initialize the ECDSA object: this will draw some entropy
|
ECDSA(SimpleFieldSet sfs,
ECDSA.Curves curve)
Initialize the ECDSA object: from an SFS generated by asFieldSet()
|
Modifier and Type | Method and Description |
---|---|
SimpleFieldSet |
asFieldSet(boolean includePrivate)
Returns an SFS containing:
- the private key
- the public key
- the name of the curve in use
It should only be used in NodeCrypto
|
java.security.interfaces.ECPublicKey |
getPublicKey() |
static java.security.interfaces.ECPublicKey |
getPublicKey(byte[] data,
ECDSA.Curves curve)
Returns an ECPublicKey from bytes obtained using ECPublicKey.getEncoded()
|
byte[] |
sign(byte[]... data) |
byte[] |
signToNetworkFormat(byte[]... data)
Sign data and return a fixed size signature.
|
boolean |
verify(byte[] signature,
byte[]... data) |
boolean |
verify(byte[] signature,
int sigoffset,
int siglen,
byte[]... data) |
static boolean |
verify(ECDSA.Curves curve,
java.security.interfaces.ECPublicKey key,
byte[] signature,
byte[]... data) |
static boolean |
verify(ECDSA.Curves curve,
java.security.interfaces.ECPublicKey key,
byte[] signature,
int sigoffset,
int siglen,
byte[]... data) |
public final ECDSA.Curves curve
public ECDSA(ECDSA.Curves curve)
curve
- public ECDSA(SimpleFieldSet sfs, ECDSA.Curves curve) throws FSParseException
curve
- FSParseException
public byte[] sign(byte[]... data)
public byte[] signToNetworkFormat(byte[]... data)
public boolean verify(byte[] signature, byte[]... data)
public boolean verify(byte[] signature, int sigoffset, int siglen, byte[]... data)
public static boolean verify(ECDSA.Curves curve, java.security.interfaces.ECPublicKey key, byte[] signature, byte[]... data)
public static boolean verify(ECDSA.Curves curve, java.security.interfaces.ECPublicKey key, byte[] signature, int sigoffset, int siglen, byte[]... data)
public java.security.interfaces.ECPublicKey getPublicKey()
public static java.security.interfaces.ECPublicKey getPublicKey(byte[] data, ECDSA.Curves curve)
data
- public SimpleFieldSet asFieldSet(boolean includePrivate)
includePrivate
- - include the (secret) private key