我正在尝试在GAE Python中实现Google Identity Toolkit(gitkitv3).用户登录网站后,我收到以下错误:
'PKCS12 format is not supported by the PyCrpto library. ' NotImplementedError: PKCS12 format is not supported by the PyCrpto library. Try converting to a "PEM" (openssl pkcs12 -in xxxxx.p12 -nodes -nocerts > privatekey.pem) or using PyOpenSSL if native code is an option.
基于SO回复,我在x.p12文件上运行以下命令,并使用生成的privatekey.pem文件:
openssl pkcs12 -passin pass:notasecret -in x.p12 -nocerts -passout pass:notasecret -out key.pem openssl pkcs8 -nocrypt -in key.pem -passin pass:notasecret -topk8 -out privatekey.pem
现在,我收到以下错误:
'X509 certs are not supported by the PyCrypto library. ' NotImplementedError: X509 certs are not supported by the PyCrypto library. Try using PyOpenSSL if native code is an option.
我从Google Developer Console下载了x.p12.如何解决这个错误?请帮忙
有什么办法吗?
我是否一定需要此文件.p12文件,还是可以将其内容复制到全局变量并使用它(作为变通方法)?有人可以解释一下这个文件的实际用途吗?
更新
看起来Google提供的PyCrypto库非常有限,缺乏支持X509的能力.