git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GPG wrapper, ECC 25519 compatible?


On 03.09.19 05:28, rmlibre at riseup.net wrote:

> But I just don't understand how to get
> and pass information back to the gpg command line prompts at all, not to
> mention automating the process.

The manpage describes how to enable the machine-parsable interface,
which is exactly what you want. Then:

import subprocess
inputs = [
	"11",
	"Q",
	"1",
	"0",
	"y",
	"username",
	"username at user.net",
	"none",
	"O",
]
input_data = ("\n".join(inputs) + "\n").encode()
subprocess.check_output([ "gpg2", "--expert", "--full-gen-key",
"--with-colons", "--command-fd", "0", "--status-fd", "1" ], input =
input_data)

Cheers,
Joe


-- 
"Performance ist nicht das Problem, es l?uft ja nachher beides auf der
selben Hardware." -- Hans-Peter Diettrich in d.s.e.