public class SECP256K1
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SECP256K1.KeyPair |
static class |
SECP256K1.PrivateKey |
static class |
SECP256K1.PublicKey |
static class |
SECP256K1.Signature |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALGORITHM |
static org.bouncycastle.crypto.params.ECDomainParameters |
CURVE |
static java.lang.String |
CURVE_NAME |
static java.math.BigInteger |
HALF_CURVE_ORDER |
static java.lang.String |
PROVIDER
Deprecated.
trident no longer registers Bouncy Castle in the JVM-global
provider list, so a provider named "BC" is not guaranteed to exist.
Callers that need it must register it themselves, e.g.
Security.addProvider(new BouncyCastleProvider()). |
| Constructor and Description |
|---|
SECP256K1() |
| Modifier and Type | Method and Description |
|---|---|
static Bytes32 |
calculateECDHKeyAgreement(SECP256K1.PrivateKey privKey,
SECP256K1.PublicKey theirPubKey)
Calculates an ECDH key agreement between the private and the public key.
|
static SECP256K1.Signature |
normaliseSignature(java.math.BigInteger nativeR,
java.math.BigInteger nativeS,
SECP256K1.PublicKey publicKey,
Bytes32 dataHash) |
static SECP256K1.Signature |
sign(Bytes32 dataHash,
SECP256K1.KeyPair keyPair) |
static boolean |
verify(Bytes data,
SECP256K1.Signature signature,
SECP256K1.PublicKey pub)
Verifies the given ECDSA signature against the message bytes using the public key bytes.
|
static boolean |
verify(Bytes data,
SECP256K1.Signature signature,
SECP256K1.PublicKey pub,
java.util.function.UnaryOperator<Bytes> preprocessor)
Verifies the given ECDSA signature using the public key bytes against the message bytes,
previously passed through a preprocessor function, which is normally a hashing function.
|
public static final java.lang.String ALGORITHM
public static final java.lang.String CURVE_NAME
@Deprecated public static final java.lang.String PROVIDER
Security.addProvider(new BouncyCastleProvider()).public static final org.bouncycastle.crypto.params.ECDomainParameters CURVE
public static final java.math.BigInteger HALF_CURVE_ORDER
public static SECP256K1.Signature sign(Bytes32 dataHash, SECP256K1.KeyPair keyPair)
public static boolean verify(Bytes data, SECP256K1.Signature signature, SECP256K1.PublicKey pub)
When using native ECDSA verification, data must be 32 bytes, and no element may be larger than 520 bytes.
data - Hash of the data to verify.signature - ASN.1 encoded signature.pub - The public key bytes to use.public static boolean verify(Bytes data, SECP256K1.Signature signature, SECP256K1.PublicKey pub, java.util.function.UnaryOperator<Bytes> preprocessor)
data - The data to verify.signature - ASN.1 encoded signature.pub - The public key bytes to use.preprocessor - The function to apply to the data before verifying the signature, normally
a hashing function.public static SECP256K1.Signature normaliseSignature(java.math.BigInteger nativeR, java.math.BigInteger nativeS, SECP256K1.PublicKey publicKey, Bytes32 dataHash)
public static Bytes32 calculateECDHKeyAgreement(SECP256K1.PrivateKey privKey, SECP256K1.PublicKey theirPubKey)
privKey - The private key.theirPubKey - The public key.