From 66a5b0ecdc89a0d8888eced3ba22d7e706cd7cfb Mon Sep 17 00:00:00 2001 From: ricmoo Date: Fri, 22 Jul 2016 02:43:19 -0400 Subject: [PATCH] Expose private key in a signing key. --- lib/signing-key.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/signing-key.js b/lib/signing-key.js index 9b5924917..e59d0e0b9 100644 --- a/lib/signing-key.js +++ b/lib/signing-key.js @@ -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);