Python Pyme:无需用户交互的简单解密
我正在使用 Pyme 与 GPGME 交互,并且签名/加密没有任何问题。然而,当我尝试解密时,尽管已通过 c.set_passphrase_cb
回调设置了密码,但它始终会提示输入密码。难道我做错了什么?
I am using Pyme to interface with GPGME and have had no problems signing / encrypting. When I try to decrypt, however, it always brings up the prompt for the passphrase despite having set it via a c.set_passphrase_cb
callback. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个类似的问题。
我的代码如下所示:
def passphrase_callback(hint='', desc='', prev_bad=''):
返回“密码”
类 CryptoEngine:
类 NoSignKeys(异常):
def init(self, str):
Exception.init(self, str)
尽管设置了密码回调,我仍然收到一个消息框,询问
密码或只是通知错误密码的异常。
有人解决了这个问题并可以分享他的知识吗?
谢谢,
严
I have a similar problem.
My code looks like this:
def passphrase_callback(hint='', desc='', prev_bad=''):
return 'password'
class CryptoEngine:
class NoSignKeys(Exception):
def init(self, str):
Exception.init(self, str)
Despite setting the passphrase callback I still either get a message box asking for the
passphrase or just an exception notifying of a bad password.
Did someone solve this problem and could share his knowledge?
Thanks,
Yan
在设置密码回调之前添加“c.set_armor(1)”。
Add "c.set_armor(1)" before you set the passphrase callback.