daklib.gpg¶
Utilities for signed files
@contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2011-2018 Ansgar Burchardt <ansgar@debian.org> @license: GNU General Public License version 2 or later
Functions
|
|
|
Classes
|
handle files signed with PGP |
Exceptions
- class daklib.gpg.SignedFile(data: bytes, keyrings: Iterable[str], require_signature: bool = True, gpg: str = '/usr/bin/gpg')[source]¶
handle files signed with PGP
- The following attributes are available:
contents - byte-string with the content (after removing PGP armor) valid - Boolean indicating a valid signature was found weak_signature - signature uses a weak algorithm (e.g. SHA-1) fingerprint - fingerprint of the key used for signing primary_fingerprint - fingerprint of the primary key associated to the key used for signing
- _parse_timestamp(timestamp, datestring=None) datetime [source]¶
parse timestamp in GnuPG’s format
- Returns:
datetime object for the given timestamp
- property signature_id¶
- class daklib.gpg._Pipe[source]¶
context manager for pipes
Note: When the pipe is closed by other means than the close_r and close_w methods, you have to set self.r (self.w) to None.