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

证书无法读取 #14

Closed
xuanyue202 opened this issue May 7, 2017 · 2 comments
Closed

证书无法读取 #14

xuanyue202 opened this issue May 7, 2017 · 2 comments

Comments

@xuanyue202
Copy link

很奇怪,我这边无论是windows还是linux在调用verify_app_notify这个函数的时候都报下面那个错
"RSA key format is not supported"

跟进去看了下,错在__init__.py 121行key = RSA.importKey(fp.read()),查了下 因为我的privatekey是base64编码,而importKey接受二进制,要么key = RSA.importKey(b64decode(fp.read())),要么 open的时候用"rb"模式,不然不可能能通过测试啊。。

@fzlee
Copy link
Owner

fzlee commented May 8, 2017

tests/certs目录下有测试使用的证书,你可以和你自己的证书文件对比一下,看看你的证书的格式是否正确。

=====
一般的key都是二进制的格式,为了可读性,所以常常用base64编码一下。

@fzlee fzlee closed this as completed May 9, 2017
@xuanyue202
Copy link
Author

恩 的确,加了header就好了 多谢

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

2 participants