Package org.bitcoinj.crypto
Class BIP38PrivateKey
- java.lang.Object
-
- org.bitcoinj.core.PrefixedChecksummedBytes
-
- org.bitcoinj.crypto.BIP38PrivateKey
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class BIP38PrivateKey extends PrefixedChecksummedBytes
Implementation of BIP 38 passphrase-protected private keys. Currently, only decryption is supported.- See Also:
- Serialized Form
-
-
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.core.PrefixedChecksummedBytes
bytes, params
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ECKey
decrypt(java.lang.String passphrase)
static BIP38PrivateKey
fromBase58(NetworkParameters params, java.lang.String base58)
Construct a password-protected private key from its Base58 representation.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.core.PrefixedChecksummedBytes
clone, equals, getParameters, hashCode
-
-
-
-
Method Detail
-
fromBase58
public static BIP38PrivateKey fromBase58(NetworkParameters params, java.lang.String base58) throws AddressFormatException
Construct a password-protected private key from its Base58 representation.- Parameters:
params
- The network parameters 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
-
-