Closed
Description
Current API parses the PEM files on every crypto operation, fx:
I would be nice if this could be done once and a ref to the openssl key could be retained:
const crypto = require('crypto');
// Read and parse key once
const privateKey = crypto.readPrivateKey(getPrivateKeySomehow());
// privateKey would be a ref to the PEM_read_bio_PrivateKey() pointer
for(let i = 0; i < 10000; i++) {
const sign = crypto.createSign('RSA-SHA256');
sign.write('some data to sign' + i);
sign.end();
console.log(sign.sign(privateKey, 'hex'));
}