本文整理汇总了Python中mailpile.crypto.gpgi.GnuPG.sign_key方法的典型用法代码示例。如果您正苦于以下问题:Python GnuPG.sign_key方法的具体用法?Python GnuPG.sign_key怎么用?Python GnuPG.sign_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailpile.crypto.gpgi.GnuPG
的用法示例。
在下文中一共展示了GnuPG.sign_key方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: command
# 需要导入模块: from mailpile.crypto.gpgi import GnuPG [as 别名]
# 或者: from mailpile.crypto.gpgi.GnuPG import sign_key [as 别名]
def command(self):
signingkey = None
keyid = None
args = list(self.args)
try: keyid = args.pop(0)
except: keyid = self.data.get("keyid", None)
try: signingkey = args.pop(0)
except: signingkey = self.data.get("signingkey", None)
print keyid
if not keyid:
return self._error("You must supply a keyid", None)
g = GnuPG()
return g.sign_key(keyid, signingkey)
示例2: command
# 需要导入模块: from mailpile.crypto.gpgi import GnuPG [as 别名]
# 或者: from mailpile.crypto.gpgi.GnuPG import sign_key [as 别名]
def command(self):
if self.session.config.sys.lockdown:
return self._error(_('In lockdown, doing nothing.'))
signingkey = None
keyid = None
args = list(self.args)
try: keyid = args.pop(0)
except: keyid = self.data.get("keyid", None)
try: signingkey = args.pop(0)
except: signingkey = self.data.get("signingkey", None)
print keyid
if not keyid:
return self._error("You must supply a keyid", None)
g = GnuPG()
return g.sign_key(keyid, signingkey)