-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
Current API parses the PEM files on every crypto operation, fx:
- https://nodejs.org/api/crypto.html#crypto_class_sign
Line 4168 in 0d22858
pkey = PEM_read_bio_PrivateKey(bp,
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'));
}
juancampa
Metadata
Metadata
Assignees
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.