Package org.web3j.crypto
Class Keys
java.lang.Object
org.web3j.crypto.Keys
Crypto key utilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic ECKeyPairstatic ECKeyPaircreateEcKeyPair(SecureRandom random) static ECKeyPairdeserialize(byte[] input) static byte[]getAddress(byte[] publicKey) static StringgetAddress(String publicKey) static StringgetAddress(BigInteger publicKey) static StringgetAddress(ECKeyPair ecKeyPair) static byte[]static StringtoChecksumAddress(String address) Checksum address encoding as per EIP-55.
-
Field Details
-
ADDRESS_SIZE
public static final int ADDRESS_SIZE- See Also:
-
ADDRESS_LENGTH_IN_HEX
public static final int ADDRESS_LENGTH_IN_HEX- See Also:
-
PRIVATE_KEY_LENGTH_IN_HEX
public static final int PRIVATE_KEY_LENGTH_IN_HEX- See Also:
-
-
Method Details
-
createEcKeyPair
public static ECKeyPair createEcKeyPair() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException -
createEcKeyPair
public static ECKeyPair createEcKeyPair(SecureRandom random) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException -
getAddress
-
getAddress
-
getAddress
-
getAddress
public static byte[] getAddress(byte[] publicKey) -
toChecksumAddress
Checksum address encoding as per EIP-55.- Parameters:
address- a valid hex encoded address- Returns:
- hex encoded checksum address
-
serialize
-
deserialize
-