pass key number

This commit is contained in:
antelle 2017-06-11 09:08:29 +02:00
parent 02563dcf8b
commit 0374f30a12
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ const signer = require('pkcs15-smartcard-sign');
const keychain = require('keychain');
const verifyKey = fs.readFileSync('keys/public-key.pem');
const key = '02';
function getPin() {
if (getPin.pin) {
@ -21,5 +22,5 @@ function getPin() {
}
module.exports = function sign(data) {
return getPin().then(pin => signer.sign({ data, verifyKey, pin }).then(data => data.toString('base64')));
return getPin().then(pin => signer.sign({ data, verifyKey, pin, key }).then(data => data.toString('base64')));
};