Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F365551
interact.py
tookmund (Jacob Adams)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
tookmund
Jun 18 2018, 8:11 PM
2018-06-18 20:11:52 (UTC+2)
Size
571 B
Subscribers
None
interact.py
View Options
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
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
211539
Attached To
T4033: Python GPGME interact bindings
Event Timeline
Log In to Comment