Package org.web3j.crypto
Class ECKeyPair
- java.lang.Object
-
- org.web3j.crypto.ECKeyPair
-
- Direct Known Subclasses:
Bip32ECKeyPair
public class ECKeyPair extends java.lang.ObjectElliptic Curve SECP-256k1 generated key pair.
-
-
Constructor Summary
Constructors Constructor Description ECKeyPair(java.math.BigInteger privateKey, java.math.BigInteger publicKey)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ECKeyPaircreate(byte[] privateKey)static ECKeyPaircreate(java.math.BigInteger privateKey)static ECKeyPaircreate(java.security.KeyPair keyPair)booleanequals(java.lang.Object o)java.math.BigIntegergetPrivateKey()java.math.BigIntegergetPublicKey()inthashCode()ECDSASignaturesign(byte[] transactionHash)Sign a hash with the private key of this key pair.
-
-
-
Method Detail
-
getPrivateKey
public java.math.BigInteger getPrivateKey()
-
getPublicKey
public java.math.BigInteger getPublicKey()
-
sign
public ECDSASignature sign(byte[] transactionHash)
Sign a hash with the private key of this key pair.- Parameters:
transactionHash- the hash to sign- Returns:
- An
ECDSASignatureof the hash
-
create
public static ECKeyPair create(java.security.KeyPair keyPair)
-
create
public static ECKeyPair create(java.math.BigInteger privateKey)
-
create
public static ECKeyPair create(byte[] privateKey)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-