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. If there are 33 private key bytes instead of 32, then
the last byte is a discriminator value for the compressed pubkey.
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.
equals
public boolean equals(Object other)
- Overrides:
equals in class VersionedChecksummedBytes
hashCode
public int hashCode()
- Overrides:
hashCode in class VersionedChecksummedBytes
Copyright © 2014. All rights reserved.