mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
get wif from eckey
This commit is contained in:
parent
3a557e3af8
commit
34bd72d87a
1 changed files with 11 additions and 0 deletions
|
@ -326,6 +326,17 @@ public class ECKey {
|
||||||
return priv;
|
return priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exports the private key in the form used by Bitcoin Core's "dumpprivkey" and "importprivkey" commands. Use
|
||||||
|
* the {@link DumpedPrivateKey#toString()} method to get the string.
|
||||||
|
*
|
||||||
|
* @return Private key bytes as a {@link DumpedPrivateKey}.
|
||||||
|
* @throws IllegalStateException if the private key is not available.
|
||||||
|
*/
|
||||||
|
public DumpedPrivateKey getPrivateKeyEncoded() {
|
||||||
|
return new DumpedPrivateKey(getPrivKeyBytes(), isCompressed());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this key is using the compressed form or not. Compressed pubkeys are only 33 bytes, not 64.
|
* Returns whether this key is using the compressed form or not. Compressed pubkeys are only 33 bytes, not 64.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue