public class ECKeyPair
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ECKeyPair.ECPrivateKey |
static class |
ECKeyPair.ECPublicKey |
| Constructor and Description |
|---|
ECKeyPair(ECKeyPair.ECPrivateKey privateKey,
ECKeyPair.ECPublicKey publicKey) |
| Modifier and Type | Method and Description |
|---|---|
static ECKeyPair |
create(java.math.BigInteger privateKey)
Creates an EC key pair from a private key.
|
static ECKeyPair |
create(byte[] privateKey)
Creates an EC key pair from a private key.
|
static ECKeyPair |
create(ECKeyPair.ECPrivateKey privateKey)
Creates an EC key pair from a private key.
|
static ECKeyPair |
create(java.security.KeyPair keyPair)
Creates an EC key pair from a key pair.
|
static ECKeyPair |
createEcKeyPair()
Create a keypair using SECP-256r1 curve.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
exportAsWIF()
Creates a WIF of this ECKeyPair.
|
java.lang.String |
getAddress()
Constructs the NEO address from this key pairs public key.
|
ECKeyPair.ECPrivateKey |
getPrivateKey()
Gets the private key of this EC key pair.
|
ECKeyPair.ECPublicKey |
getPublicKey()
Gets the public key of this EC key pair.
|
int |
hashCode() |
java.math.BigInteger[] |
sign(byte[] transactionHash)
Sign a hash with the private key of this key pair.
|
byte[] |
signAndGetArrayBytes(byte[] transactionHash)
Sign a hash with the private key of this key pair.
|
ECDSASignature |
signAndGetECDSASignature(byte[] transactionHash)
Sign a hash with the private key of this key pair.
|
public ECKeyPair(ECKeyPair.ECPrivateKey privateKey, ECKeyPair.ECPublicKey publicKey)
public ECKeyPair.ECPrivateKey getPrivateKey()
public ECKeyPair.ECPublicKey getPublicKey()
public java.lang.String getAddress()
The address is constructed ad hoc each time this method is called.
public java.math.BigInteger[] sign(byte[] transactionHash)
transactionHash - the hash to signBigInteger array with the signaturepublic ECDSASignature signAndGetECDSASignature(byte[] transactionHash)
transactionHash - the hash to signECDSASignature of the hashpublic byte[] signAndGetArrayBytes(byte[] transactionHash)
transactionHash - the hash to signpublic static ECKeyPair create(java.security.KeyPair keyPair)
keyPair - the key pair.public static ECKeyPair create(ECKeyPair.ECPrivateKey privateKey)
privateKey - the private key.public static ECKeyPair create(java.math.BigInteger privateKey)
privateKey - the private key.public static ECKeyPair create(byte[] privateKey)
privateKey - the private key.public static ECKeyPair createEcKeyPair() throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
Create a keypair using SECP-256r1 curve.
Private keypairs are encoded using PKCS8.
Private keys are encoded using X.509.
ECKeyPair.java.security.InvalidAlgorithmParameterException - throws if the algorithm parameter used is
invalid.java.security.NoSuchAlgorithmException - throws if the encryption algorithm is not
available in the specified provider.java.security.NoSuchProviderException - throws if the provider is not available.public java.lang.String exportAsWIF()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object