Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign(privateKey, ...) 报 PEM_read_bio_PrivateKey failed #17

Closed
xfcdxg opened this issue Feb 13, 2018 · 8 comments
Closed

sign(privateKey, ...) 报 PEM_read_bio_PrivateKey failed #17

xfcdxg opened this issue Feb 13, 2018 · 8 comments

Comments

@xfcdxg
Copy link

xfcdxg commented Feb 13, 2018

nodejs: v8.9.4

alipay-mobile: v2.2.1

我用你项目中测试用例里的 app_priv_key.pem 也会报这个错。

麻烦看看呗,是啥问题导致的呢?

@xfcdxg xfcdxg closed this as completed Feb 20, 2018
@Luncher
Copy link
Owner

Luncher commented Feb 22, 2018

@xfcdxg 问题解决了吗?

@xfcdxg
Copy link
Author

xfcdxg commented Feb 26, 2018

@Luncher 用支付宝提供的工具生成的公私钥解析失败。但是我自己生成了一组公私钥,就可以了。

@Luncher
Copy link
Owner

Luncher commented Feb 27, 2018

之前我用过支付宝的工具,确认是可以用的。支付宝推荐的加密算法是AES256。

@xfcdxg
Copy link
Author

xfcdxg commented Feb 28, 2018

@Luncher 解析与系统有关系吗?我用的是MacOS

@Luncher
Copy link
Owner

Luncher commented Feb 28, 2018

不确定,之前用的fedora试的,回头我在mac试一下。

@ruta0
Copy link

ruta0 commented Aug 23, 2018

我遇到了同一个问题: ·PEM_read_bio_PrivateKey failed·
我的公私钥是用支付宝提供的工具生成的。我的操作环境是macOS。

@Luncher
Copy link
Owner

Luncher commented Aug 24, 2018

能不能Debug看一下,把错误信息贴一下,我现在手头没有对应的项目。

@ruta0
Copy link

ruta0 commented Aug 24, 2018

我尝试了用OpenSSL自己生成一对public and private keys,这反而成功了。奇怪了...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants