com.google.bitcoin.core
Class DumpedPrivateKey
java.lang.Object
com.google.bitcoin.core.VersionedChecksummedBytes
com.google.bitcoin.core.DumpedPrivateKey
public class DumpedPrivateKey
- extends VersionedChecksummedBytes
Parses and generates private keys in the form used by the Bitcoin "dumpprivkey" command. This is the private key
bytes with a header byte and 4 checksum bytes at the end.
Method Summary |
ECKey |
getKey()
Returns an ECKey created from this encoded private key. |
DumpedPrivateKey
public DumpedPrivateKey(NetworkParameters params,
byte[] keyBytes)
- Allows the output of a private key in versioned, checksummed form.
- Parameters:
params
- The network parameters of this key, needed for the version byte.keyBytes
- The 256-bit private key.
DumpedPrivateKey
public DumpedPrivateKey(NetworkParameters params,
String encoded)
throws AddressFormatException
- Parses the given private key as created by the "dumpprivkey" Bitcoin C++ RPC.
- Parameters:
params
- The expected network parameters of the key. If you don't care, provide null.encoded
- The base58 encoded string.
- Throws:
AddressFormatException
- If the string is invalid or the header byte doesn't match the network params.
getKey
public ECKey getKey()
- Returns an ECKey created from this encoded private key.
Copyright © 2011. All Rights Reserved.