Skip to content

Commit

Permalink
load keypair
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Sep 18, 2018
1 parent ee0b57a commit bd782fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/KeyUtil.java
Expand Up @@ -41,6 +41,13 @@ public static ByteString getCompressedPublicKeyEncoding(PublicKey key)
return full.substring(EC_SECP256K1_PREFIX.size());
}

public static KeyPair decodeKeypair(WalletKeyPair wkp)
throws ValidationException
{
String algo = SignatureUtil.getAlgo(wkp.getSignatureType());
return new KeyPair( decodeKey( wkp.getPublicKey(), algo), decodePrivateKey(wkp.getPrivateKey(), algo));
}

public static PublicKey decodeKey(ByteString encoded, String algo)
throws ValidationException
{
Expand Down

0 comments on commit bd782fa

Please sign in to comment.