bdisk/docs/manual/dev/functions/BGPG.adoc

1.8 KiB
Raw Blame History

bGPG.py

This contains functions having to do with GPGsigning files, verifying other signatures, generating a key (if one wasnt specified), using a key (if one was specified), etc.

genGPG(conf)

This function controls generating (or "importing" an existing) GnuPG key for use with other operations. Returns gpg, a PyGPGME object.

conf

A dictionary of the configuration (with some additional keys/values added). See (TODO: link to host.pys config parser).

killStaleAgent(conf)

This function kills off any stale GnuPG agents running. Not doing so can cause some strange behaviour both during the build process and on the host.

conf

See [conf].

signIMG(path, conf)

This function signs a given file with the keys BDisk was either configured to use or automatically generated.

path

The full, absolute path to the file to be signed. An ASCII-armored detached signature (plaintext) will be generated at path.asc, and a binary detached signature will be generated at path.sig.

conf

See [conf].

gpgVerify(sigfile, datafile, conf)

This function verifies a detatched signature against a file containing data. Returns True if the file verifies, or False if not.

sigfile

The detached signature file. Can be ASCII-armored or binary format. Full/absolute path only.

datafile

The file containing the data to be verified. Full/absolute path only.

conf

See [conf].

delTempKeys(conf)

Delete automatically-generated keys (if we generated them) as well as the automatically imported verification key ([code_gpgkey_code]).

conf

See [conf].