public class Keys
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_LENGTH_IN_HEX |
static int |
ADDRESS_SIZE |
static int |
PRIVATE_KEY_LENGTH_IN_HEX |
| Modifier and Type | Method and Description |
|---|---|
static ECKeyPair |
createEcKeyPair() |
static ECKeyPair |
createEcKeyPair(java.security.SecureRandom random) |
static ECKeyPair |
deserialize(byte[] input) |
static java.lang.String |
getAddress(java.math.BigInteger publicKey) |
static byte[] |
getAddress(byte[] publicKey) |
static java.lang.String |
getAddress(ECKeyPair ecKeyPair) |
static java.lang.String |
getAddress(java.lang.String publicKey) |
static byte[] |
serialize(ECKeyPair ecKeyPair) |
static java.lang.String |
toChecksumAddress(java.lang.String address)
Checksum address encoding as per EIP-55.
|
public static final int ADDRESS_SIZE
public static final int ADDRESS_LENGTH_IN_HEX
public static final int PRIVATE_KEY_LENGTH_IN_HEX
public static ECKeyPair createEcKeyPair() throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
java.security.InvalidAlgorithmParameterExceptionjava.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionpublic static ECKeyPair createEcKeyPair(java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
java.security.InvalidAlgorithmParameterExceptionjava.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionpublic static java.lang.String getAddress(ECKeyPair ecKeyPair)
public static java.lang.String getAddress(java.math.BigInteger publicKey)
public static java.lang.String getAddress(java.lang.String publicKey)
public static byte[] getAddress(byte[] publicKey)
public static java.lang.String toChecksumAddress(java.lang.String address)
address - a valid hex encoded addresspublic static byte[] serialize(ECKeyPair ecKeyPair)
public static ECKeyPair deserialize(byte[] input)