Class Wif
java.lang.Object
com.codename1.crypto.bitcoin.Wif
Wallet Import Format: a private key in Base58Check, the form paper wallets and
dumpprivkey use. The trailing 0x01 flag says the key's addresses use the compressed
public key.-
Method Summary
Modifier and TypeMethodDescriptionstatic Wifdecode(String wif, BitcoinNetwork network) Decodes a WIF string of the given network.voiddestroy()Wipes the private key.static Stringencode(byte[] privateKey, boolean compressed, BitcoinNetwork network) Encodes a private key.The network.byte[]A copy of the private key.byte[]The public key in the form the flag selects.booleanTells whether the key's addresses use the compressed public key.
-
Method Details
-
encode
Encodes a private key. -
decode
Decodes a WIF string of the given network.
Throws
IllegalArgumentException: for a malformed key, a bad checksum or another network
-
getPrivateKey
public byte[] getPrivateKey()A copy of the private key. Wipe it after use. -
isCompressed
public boolean isCompressed()Tells whether the key's addresses use the compressed public key. -
getPublicKey
public byte[] getPublicKey()The public key in the form the flag selects. -
getNetwork
The network. -
destroy
public void destroy()Wipes the private key.
-