public class Keys
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
checkAndEncodePublicKey(byte[] publicKey)
Checks if the given public key is in encoded format and encodes it if not.
|
static java.lang.String |
getAddress(java.math.BigInteger publicKey) |
static java.lang.String |
getAddress(byte[] publicKey) |
static java.lang.String |
getAddress(java.lang.String publicKeyWithNoPrefix) |
static java.lang.String |
getMultiSigAddress(int amountSignatures,
java.math.BigInteger... publicKeys) |
static java.lang.String |
getMultiSigAddress(int amountSignatures,
byte[]... publicKeys) |
static java.lang.String |
getMultiSigAddress(int amountSignatures,
java.util.List<java.math.BigInteger> publicKeys) |
static byte[] |
getPublicKeyEncoded(byte[] publicKeyNotEncoded) |
static byte[] |
getScriptHashFromPublicKey(byte[] publicKey)
Deprecated.
|
static byte[] |
getScriptHashFromPublicKey(int amountSignatures,
byte[]... publicKeys)
Deprecated.
Use
ScriptHash.fromPublicKey(byte[]) instead. |
static byte[] |
getVerificationScriptFromPublicKey(java.math.BigInteger publicKey)
Creates the verification script for the given key.
|
static byte[] |
getVerificationScriptFromPublicKey(byte[] publicKey)
Creates the verification script for the given key.
|
static byte[] |
getVerificationScriptFromPublicKeys(int signingThreshold,
byte[]... publicKeys)
Creates the multi-sig verification script for the given keys and the signing threshold.
|
static byte[] |
getVerificationScriptFromPublicKeys(int signingThreshold,
java.util.List<java.math.BigInteger> publicKeys)
Creates the multi-sig verification script for the given keys and the signing threshold.
|
static boolean |
isPublicKeyEncoded(byte[] publicKey) |
static boolean |
isValidAddress(java.lang.String address) |
static byte[] |
privateKeyIntegerToByteArray(java.math.BigInteger privateKey) |
static byte[] |
publicKeyIntegerToByteArray(java.math.BigInteger publicKey) |
static java.lang.String |
scriptHashToAddress(java.lang.String scriptHash)
Deprecated.
Use
ScriptHash.toAddress() instead. |
static java.lang.String |
toAddress(byte[] scriptHash)
Deprecated.
Use
ScriptHash.toAddress() instead. |
static byte[] |
toScriptHash(java.lang.String address)
Deprecated.
Use
ScriptHash.fromAddress(String) instead. |
public static java.lang.String getAddress(java.math.BigInteger publicKey)
public static java.lang.String getAddress(java.lang.String publicKeyWithNoPrefix)
public static java.lang.String getAddress(byte[] publicKey)
public static java.lang.String getMultiSigAddress(int amountSignatures,
java.util.List<java.math.BigInteger> publicKeys)
public static java.lang.String getMultiSigAddress(int amountSignatures,
java.math.BigInteger... publicKeys)
public static java.lang.String getMultiSigAddress(int amountSignatures,
byte[]... publicKeys)
@Deprecated public static byte[] getScriptHashFromPublicKey(byte[] publicKey)
publicKey - The public key to calculate the script hash for.@Deprecated
public static byte[] getScriptHashFromPublicKey(int amountSignatures,
byte[]... publicKeys)
ScriptHash.fromPublicKey(byte[]) instead.amountSignatures - The signing threshold for the set of public keys.publicKeys - The public keys.public static byte[] checkAndEncodePublicKey(byte[] publicKey)
publicKey - Key to encode.public static byte[] publicKeyIntegerToByteArray(java.math.BigInteger publicKey)
public static byte[] privateKeyIntegerToByteArray(java.math.BigInteger privateKey)
public static byte[] getVerificationScriptFromPublicKey(java.math.BigInteger publicKey)
publicKey - Key to create script for.public static byte[] getVerificationScriptFromPublicKey(byte[] publicKey)
publicKey - Key to create script for.public static byte[] getVerificationScriptFromPublicKeys(int signingThreshold,
java.util.List<java.math.BigInteger> publicKeys)
signingThreshold - the minimum number of public keys needed to sign transactions from
the given public keys.publicKeys - the public keys to create the script for.public static byte[] getVerificationScriptFromPublicKeys(int signingThreshold,
byte[]... publicKeys)
signingThreshold - the minimum number of public keys needed to sign transactions from
the given public keys.publicKeys - the public keys to create the script for.public static byte[] getPublicKeyEncoded(byte[] publicKeyNotEncoded)
public static boolean isPublicKeyEncoded(byte[] publicKey)
@Deprecated public static java.lang.String toAddress(byte[] scriptHash)
ScriptHash.toAddress() instead.Derives the address from the given script hash.
The script hash needs to be in little-endian order.
scriptHash - The script hash to get the address for.public static boolean isValidAddress(java.lang.String address)
@Deprecated public static byte[] toScriptHash(java.lang.String address)
ScriptHash.fromAddress(String) instead.address - The address to get the script hash for.@Deprecated public static java.lang.String scriptHashToAddress(java.lang.String scriptHash)
ScriptHash.toAddress() instead.Derives the address from the given script hash.
The script hash needs to be in little-endian order.
scriptHash - The script hash to get the address for.