Package org.bitcoinj.crypto
Class BIP38PrivateKey
- java.lang.Object
-
- org.bitcoinj.crypto.EncodedPrivateKey
-
- org.bitcoinj.crypto.BIP38PrivateKey
-
public class BIP38PrivateKey extends EncodedPrivateKey
Implementation of BIP 38 passphrase-protected private keys. Currently, only decryption is supported.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BIP38PrivateKey.BadPassphraseException
-
Field Summary
Fields Modifier and Type Field Description byte[]
addressHash
boolean
compressed
byte[]
content
boolean
ecMultiply
boolean
hasLotAndSequence
-
Fields inherited from class org.bitcoinj.crypto.EncodedPrivateKey
bytes, network
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ECKey
decrypt(java.lang.String passphrase)
static BIP38PrivateKey
fromBase58(Network network, java.lang.String base58)
Construct a password-protected private key from its Base58 representation.static BIP38PrivateKey
fromBase58(NetworkParameters params, java.lang.String base58)
Deprecated.java.lang.String
toBase58()
Returns the base58-encoded textual form, including version and checksum bytes.java.lang.String
toString()
-
Methods inherited from class org.bitcoinj.crypto.EncodedPrivateKey
equals, getParameters, hashCode, network
-
-
-
-
Method Detail
-
fromBase58
public static BIP38PrivateKey fromBase58(Network network, java.lang.String base58) throws AddressFormatException
Construct a password-protected private key from its Base58 representation.- Parameters:
network
- The network of the chain that the key is for.base58
- The textual form of the password-protected private key.- Throws:
AddressFormatException
- if the given base58 doesn't parse or the checksum is invalid
-
fromBase58
@Deprecated public static BIP38PrivateKey fromBase58(NetworkParameters params, java.lang.String base58) throws AddressFormatException
Deprecated.Construct a password-protected private key from its Base58 representation.- Parameters:
params
- The network of the chain that the key is for.base58
- The textual form of the password-protected private key.- Throws:
AddressFormatException
- if the given base58 doesn't parse or the checksum is invalid
-
toBase58
public java.lang.String toBase58()
Returns the base58-encoded textual form, including version and checksum bytes.- Returns:
- textual form
-
decrypt
public ECKey decrypt(java.lang.String passphrase) throws BIP38PrivateKey.BadPassphraseException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-