class SECP256K1
(source)
An Elliptic Curve Digital Signature using parameters as used by Bitcoin, and defined in Standards for Efficient Cryptography (SEC) (Certicom Research, http://www.secg.org/sec2-v2.pdf).
This class depends upon the BouncyCastle library being available and added as a java.security.Provider. See https://www.bouncycastle.org/wiki/display/JA1/Provider+Installation.
BouncyCastle can be included using the gradle dependency 'org.bouncycastle:bcprov-jdk15on'.
class KeyPair
A SECP256K1 key pair. |
|
class Parameters |
|
class PublicKey
A SECP256K1 public key. |
|
class SecretKey : Destroyable
A SECP256K1 private key. |
|
class Signature
A SECP256K1 digital signature. |
static fun calculateKeyAgreement(privKey: SecretKey, theirPubKey: PublicKey): Bytes32
Calculates an ECDH key agreement between the private and the public key of another party, formatted as a 32 bytes array. |
|
static fun sign(data: ByteArray, keyPair: KeyPair): Signature static fun sign(data: Bytes, keyPair: KeyPair): Signature
Generates an ECDSA signature. |
|
static fun signHashed(hash: ByteArray, keyPair: KeyPair): Signature static fun signHashed(hash: Bytes32, keyPair: KeyPair): Signature
Generates an ECDSA signature. |
|
static fun verify(data: ByteArray, signature: Signature, publicKey: PublicKey): Boolean static fun verify(data: Bytes, signature: Signature, publicKey: PublicKey): Boolean
Verifies the given ECDSA signature against the message bytes using the public key bytes. |
|
static fun verifyHashed(hash: Bytes32, signature: Signature, publicKey: PublicKey): Boolean static fun verifyHashed(hash: ByteArray, signature: Signature, publicKey: PublicKey): Boolean
Verifies the given ECDSA signature against the message bytes using the public key bytes. |