首页 > 解决方案 > 错误:错误: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'));

标签: node.jsnode-modules

解决方案


推荐阅读