Expose private key in a signing key.

This commit is contained in:
ricmoo 2016-07-22 02:43:19 -04:00
parent 2605e7de40
commit 66a5b0ecdc

@ -105,6 +105,7 @@ function SigningKey(privateKey) {
} else if (!Buffer.isBuffer(privateKey) || privateKey.length !== 32) {
throw new Error('invalid private key');
}
utils.defineProperty(this, 'privateKey', '0x' + privateKey.toString('hex'))
var keyPair = secp256k1.keyFromPrivate(privateKey);
var publicKey = (new Buffer(keyPair.getPublic(false, 'hex'), 'hex')).slice(1);