public class SECP256K1 extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SECP256K1.KeyPair |
static class |
SECP256K1.PrivateKey |
static class |
SECP256K1.PublicKey |
static class |
SECP256K1.Signature |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ALGORITHM |
static org.bouncycastle.crypto.params.ECDomainParameters |
CURVE |
static String |
CURVE_NAME |
static BigInteger |
HALF_CURVE_ORDER |
static String |
PROVIDER |
| 构造器和说明 |
|---|
SECP256K1() |
| 限定符和类型 | 方法和说明 |
|---|---|
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(BigInteger nativeR,
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,
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 org.bouncycastle.crypto.params.ECDomainParameters CURVE
public static final 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 SECP256K1.Signature normaliseSignature(BigInteger nativeR, BigInteger nativeS, SECP256K1.PublicKey publicKey, Bytes32 dataHash)
public static boolean verify(Bytes data, SECP256K1.Signature signature, SECP256K1.PublicKey pub, 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 Bytes32 calculateECDHKeyAgreement(SECP256K1.PrivateKey privKey, SECP256K1.PublicKey theirPubKey)
privKey - The private key.theirPubKey - The public key.Copyright © 2021. All rights reserved.