public class Secp256k1KeyPairBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ALGORITHM |
static String |
CURVE_NAME |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
convertFromDER(byte[] asn1EncodedSignature)
Converts an DER ASN.1 signature to a P1363 Signature
|
byte[] |
convertToDER(byte[] p1363EncodedSignature)
Converts a P1363 encoded signature to a DER ASN1 signature
|
PublicKey |
createPublicKey(byte[] publicKey)
Creates a public key from the provided raw bytes
|
KeyPair |
generateKeyPair(byte[] seed)
Generates a new key pair
|
Algorithm |
getAlgorithm()
The algorithm of the signer
|
byte[] |
getPublicKeyRawBytes(PublicKey publicKey)
Obtains the raw bytes from a public key so can be used in casper types
|
boolean |
isSupportedPublicKey(PublicKey publicKey)
Indicates if the provided public key has an algorithm that is supported by this signer
|
public static final String CURVE_NAME
public static final String ALGORITHM
public KeyPair generateKeyPair(byte[] seed)
KeyPairBuilderseed - the optional entropy source to be used when generating a key pairpublic boolean isSupportedPublicKey(PublicKey publicKey)
KeyPairBuilderpublicKey - the public key to testpublic PublicKey createPublicKey(byte[] publicKey)
KeyPairBuilderpublicKey - the public key raw bytespublic byte[] convertFromDER(byte[] asn1EncodedSignature)
convertFromDER in interface KeyPairBuilderasn1EncodedSignature - the DER signature bytespublic byte[] convertToDER(byte[] p1363EncodedSignature)
convertToDER in interface KeyPairBuilderp1363EncodedSignature - the signature the convertpublic Algorithm getAlgorithm()
KeyPairBuildergetAlgorithm in interface KeyPairBuilderpublic byte[] getPublicKeyRawBytes(PublicKey publicKey)
KeyPairBuildergetPublicKeyRawBytes in interface KeyPairBuilderpublicKey - the public key to obtain the raw bytes fromCopyright © 2022. All rights reserved.