alipay/alipay-sdk-nodejs-all

证书模式签名报错

cffycls opened this issue · 7 comments

// 计算签名
const sign = crypto.createSign(ALIPAY_ALGORITHM_MAPPING[config.signType])
    .update(signStr, 'utf8').sign(config.privateKey, 'base64');

通过打断点和日志确定是 sign(config.privateKey, 'base64') 这步的问题,该怎么解决


opensslErrorStack: [
'error:04093004:rsa routines:old_rsa_priv_decode:RSA lib',
'error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error',
'error:0D06C03A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error'
],
library: 'asn1 encoding routines',
function: 'asn1_check_tlen',
reason: 'wrong tag',
code: 'ERR_OSSL_ASN1_WRONG_TAG'

+1,我也遇到这个问题,请问你解决了吗?

发现是证书问题..重新上传了下,好了

新版支付宝开发平台助手中,私钥要:转PKCS1(非JAVA适用)私钥 才行

image

他们知道!但是他们不写在文档里! 原来的工具是可以选择PKCS1的,但是新的里面没有选项也没写,若干年后忘记这事之后又要花时间去查为什么。

服气,这么重要的说明不写在文档里