static privateDecrypt(key, data) { return crypto.privateDecrypt({ key: key.toPem(), padding: crypto.constants.RSA_PKCS1_PADDING, }, data); }
const rsaEncrypt = (buffer, key) => { buffer = Buffer.concat([Buffer.alloc(128 - buffer.length), buffer]) return crypto.publicEncrypt({key: key, padding: crypto.constants.RSA_NO_PADDING}, buffer) }
static publicEncrypt(key, data) { return crypto.publicEncrypt({ key: key.toPem(), padding: crypto.constants.RSA_PKCS1_PADDING, }, data); }
const rsaEncrypt = (buffer, key) => { buffer = Buffer.concat([Buffer.alloc(128 - buffer.length), buffer]) return crypto.publicEncrypt({key: key, padding: crypto.constants.RSA_NO_PADDING}, buffer) }