node.js - 错误:错误:04099079:rsa 例程:RSA_padding_check_PKCS1_OAEP_mgf1:oaep 解码错误
问题描述
我正在尝试解密使用 crypto.publicEncrypt 加密的消息,但出现以下错误:
internal/crypto/cipher.js:44
return method(toBuf(key), buffer, padding, passphrase);
^
Error: error:04099079:rsa routines:RSA_padding_check_PKCS1_OAEP_mgf1:oaep decoding error
at Object.privateDecrypt (internal/crypto/cipher.js:44:12)
let enc = crypto.privateDecrypt({
key: privateKey,
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING
}, Buffer.from(message, 'base64'));
解决方案
推荐阅读
- json - 使用 jq 获取值为 true 的 id
- cython - 如何将列表移到 cython cdef 之外?
- oracle - ORACLE 如何获取这种格式的数据
- spring - 如何从 vuejs 触发 spring 批处理执行
- javascript - 相同的功能但不同的ID和ajax中的相同变量不起作用
- python - 在运行 setup.py build_ext 时防止虚假 -m32 标志
- php - 以 json 格式完全返回相关的 eloquent 模型
- c# - JSON数组到字典
- python - python:如何将 dict 列表转换为 json 文件?
- python - 如何为树图中的每个矩形添加子图?