public class Secp256k1KeyPairBuilder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALGORITHM |
static java.lang.String |
CURVE_NAME |
| Modifier and Type | Method and Description |
|---|---|
java.security.PublicKey |
createPublicKey(byte[] publicKey)
Creates a public key from the provided raw bytes
|
java.security.KeyPair |
generateKeyPair(byte[] seed)
Generates a new key pair
|
Algorithm |
getAlgorithm()
The algorithm of the signer
|
byte[] |
getPublicKeyRawBytes(java.security.PublicKey publicKey)
Obtains the raw bytes from a public key so can be used in casper types
|
boolean |
isSupportedPublicKey(java.security.PublicKey publicKey)
Indicates if the provided public key has an algorithm that is supported by this signer
|
byte[] |
signWithPrivateKey(java.security.PrivateKey privateKey,
byte[] message)
Signs a message using the provided key
|
boolean |
verifySignature(java.security.PublicKey publicKey,
byte[] message,
byte[] signature)
Verifies a signed message
|
public static final java.lang.String CURVE_NAME
public static final java.lang.String ALGORITHM
public java.security.KeyPair generateKeyPair(byte[] seed)
KeyPairBuilderseed - the optional entropy source to be used when generating a key pairpublic boolean isSupportedPublicKey(java.security.PublicKey publicKey)
KeyPairBuilderpublicKey - the public key to testpublic java.security.PublicKey createPublicKey(byte[] publicKey)
KeyPairBuilderpublicKey - the public key raw bytespublic byte[] signWithPrivateKey(java.security.PrivateKey privateKey,
byte[] message)
KeyPairBuilderprivateKey - the private key to sign withmessage - the message to signpublic boolean verifySignature(java.security.PublicKey publicKey,
byte[] message,
byte[] signature)
KeyPairBuilderpublicKey - the public key to verify signature withmessage - the message to signsignature - the signed messagepublic Algorithm getAlgorithm()
KeyPairBuildergetAlgorithm in interface KeyPairBuilderpublic byte[] getPublicKeyRawBytes(java.security.PublicKey publicKey)
KeyPairBuildergetPublicKeyRawBytes in interface KeyPairBuilderpublicKey - the public key to obtain the raw bytes from