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 classBIP38PrivateKey.BadPassphraseException
-
Field Summary
Fields Modifier and Type Field Description byte[]addressHashbooleancompressedbyte[]contentbooleanecMultiplybooleanhasLotAndSequence-
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 ECKeydecrypt(java.lang.String passphrase)static BIP38PrivateKeyfromBase58(NetworkParameters params, java.lang.String base58)Construct a password-protected private key from its Base58 representation.java.lang.StringtoBase58()Returns the base58-encoded textual form, including version and checksum bytes.java.lang.StringtoString()-
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:
toStringin classjava.lang.Object
-
-