shima-park / unionpay

Unionpay payments API for Go (golang)
Apache License 2.0
16 stars 7 forks source link

unknown key type "PRIVATE KEY", want "RSA PRIVATE KEY" #2

Closed chengxiao closed 5 years ago

chengxiao commented 5 years ago

在使用 demo 代码跑成功了,但是尝试换成自己的测试 key 和 cert 中 使用代码中的方法

openssl pkcs12 -in my.pfx -clcerts -nokeys -out key.cert

openssl pkcs12 -in my.pfx -nocerts -nodes -out key.pem

然后在打码中使用会报

unknown key type "PRIVATE KEY", want "RSA PRIVATE KEY"

shima-park commented 5 years ago

粗看感觉是生成的 key.pem不对, 你和我示例中的key.pem格式比较一下看,是否有区别.