Python gnupg无法验证独立签名的文件
我已经使用命令行和以下命令签署了一个文件:
gpg - 输出doc.sig -detach-sig“ import json.py”
当我使用以下python脚本来验证相同的相同时使用doc.sig
的文件始终返回未经验证
,我不确定我在做什么错。
Python脚本:
import gnupg
import tempfile
gpg = gnupg.GPG('/usr/local/bin/gpg')
verified = gpg.verify_file('doc.sig','import json.py')
print ("Verified" if verified else "Unverified")
I have detach signed a file using command line and the following command:
gpg --output doc.sig --detach-sig "import json.py"
When I use the following python script to verify the same file using the doc.sig
it always returns unverified
and I am not sure what I am doing wrong.
Python Script:
import gnupg
import tempfile
gpg = gnupg.GPG('/usr/local/bin/gpg')
verified = gpg.verify_file('doc.sig','import json.py')
print ("Verified" if verified else "Unverified")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,上述问题的答案是您要确保没有多个GNUPG/GPG安装。
只有一个
python-gnupg
安装。Okay, the answer to the above problem is that you want to make sure you don't have multiple gnupg/gpg installations.
Just one
python-gnupg
install.