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) |
static byte[] |
getScriptHashFromPublicKey(int amountSignatures,
byte[]... publicKeys) |
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 input) |
static java.lang.String |
toAddress(byte[] scriptHash) |
static byte[] |
toScriptHash(java.lang.String address) |
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)
public static byte[] getScriptHashFromPublicKey(byte[] publicKey)
public static byte[] getScriptHashFromPublicKey(int amountSignatures,
byte[]... publicKeys)
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)
public static java.lang.String toAddress(byte[] scriptHash)
public static boolean isValidAddress(java.lang.String address)
public static byte[] toScriptHash(java.lang.String address)
public static java.lang.String scriptHashToAddress(java.lang.String input)