Page MenuHome GnuPG
Authored By
tookmund
Jun 18 2018, 8:11 PM
Size
571 B
Subscribers
None

interact.py

import gpg
import tempfile
# This is what I've figured out so far:
# I don't know what the first argument of the func tuple is supposed to be
# op_interact(key, flags, (True, func, handle), out)
# interact(status, args, handle)
def func(status=None, args=None, handle=False):
print(status, args, handle)
return 0
tmp = tempfile.TemporaryDirectory()
ctx = gpg.Context(home_dir=tmp.name)
kr = ctx.create_key("test <test@example.com>", algorithm="rsa1024")
key = ctx.get_key(kr.fpr)
flags = 0
out = gpg.Data()
ctx.op_interact(key, flags, (False, func, True), out)

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
211539

Event Timeline