错误的 base64 解码 - M2Crypto - Python - Android - RSA
尝试在我的服务器(Django/Python)上实现应用内计费的签名验证。
我发现这个很棒的主题,但我'我对这一行有疑问:
rsa = RSA.load_pub_key_bio(bio)
如果我完全按照那里的编码进行操作,我会得到一个“RSAError:没有起始行”[这是有道理的,因为 python 并不真正喜欢 pem 的定义方式]
我决定将我的密钥放入.pem 文件和加载它
rsa = RSA.load_pub_key("public.pem")
但是,我得到一个“RSAError:错误的base64解码”。有什么想法吗?
Trying to implement the signature verification of inapp billing on my server (Django/Python).
I found this great topic but I'm having issues with this line:
rsa = RSA.load_pub_key_bio(bio)
If I do it exactly as it is coded there I get a "RSAError: no start line" [and this makes sense since python didnt really like how pem was defined]
I decided to put my key into a .pem file and load it with
rsa = RSA.load_pub_key("public.pem")
However, I get a "RSAError: bad base64 decode" . Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,找到并解决了我的问题(但解释会很简洁)。
我必须每 75 个字符有一个 \n ...像这样格式化它才能工作。
Okay, found and fixed my problem (but an explanation would be neat).
I had to have a \n every 75 chars ... formatting it like this made it work.