我终于找到了答案。可以通过node-forge npm模块实现与“ RSA / ECB /
OAEPWithSHA-256AndMGF1Padding”等效。https://www.npmjs.com/package/node-
forge#rsa
// encrypt data with a public key using RSAES-OAEP/SHA-256/MGF1-SHA-1// compatible with Java's RSA/ECB/OAEPWithSHA-256AndMGF1Paddingvar encrypted = publicKey.encrypt(bytes, 'RSA-OAEP', { md: forge.md.sha256.create(), mgf1: { md: forge.md.sha256.create() }});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)