How to use the publicKeyFromPem function from node-forge
Find comprehensive JavaScript node-forge.publicKeyFromPem code examples handpicked from public code repositorys.
4 5 6 7 8 9 10 11 12 13
var utils = require('./utils'); var pki = require('node-forge').pki; function encryptKeyInfoWithScheme(symmetricKey, options, scheme, callback) { try { var rsa_pub = pki.publicKeyFromPem(options.rsa_pub); var encrypted = rsa_pub.encrypt(symmetricKey.toString('binary'), scheme); var base64EncodedEncryptedKey = new Buffer(encrypted, 'binary').toString('base64'); var params = {
54
0
2
GitHub: zkemail/zk-email-verify
334 335 336 337 338 339 340 341 342 343
let modulusLength; if (publicKeyObj.algorithm) { modulusLength = publicKeyObj.algorithm.modulusLength; } else { // fall back to node-forge const pubKeyData = pki.publicKeyFromPem(publicKeyPem.toString()); modulusLength = pubKeyData.n.bitLength(); } if (keyType === "rsa" && modulusLength < 1024) {
10
78
9
+ 70 other calls in file
node-forge.pki is the most popular function in node-forge (10287 examples)