Verifying Digital Signature on Google App Engine

依然范特西╮ 提交于 2019-12-23 03:32:26

问题


I'm using GAE (python) and have to verify a digital signature using a public key (pem format) I cant use M2Crypto (its not supported on GAE) and neither the following code is working:

pubKey = pem

from Crypto import PublicKey
key = PublicKey.RSA.importKey(pubKey)

Now, for this code to work we have to have Pycrypto package, which is already there in appengine, still the 'impotkey()' function is giving error Also, I'm unable to find the class RSAImplementation in Pycrypto package in GAE

EDIT:

OKAY, After few hours of mind boggling, finally figured out the problem. The problem is with the version of pycrypto module. From what I see, GAE supports Pycrypto version 2.0.1, which does not seem to have certain classes and methods, like RSAImplementation and ImportKey() I updated Pycrypto to 2.4, on my local machine, and there it is able to figure out RSAImplementation and importKey().

Also checked out the changelog for Pycrypto https://github.com/dlitz/pycrypto/blob/62247ca754657b6ee8370d8fd62c58b8b881f396/ChangeLog Looks like support for importing public key in pem format is only from version 2.2

Still the basic problem remains..How to verify a digital signature using RSA, on GAE (since GAE is using Pycrypto version 2.0.1)

来源:https://stackoverflow.com/questions/8516277/verifying-digital-signature-on-google-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!