class documentation
class GPGSignatureVendor(SignatureSigner, SignatureVerifier):
Constructors: GPGSignatureVendor.from_config(config, keyids), GPGSignatureVendor(min_trust_level, keyids)
Signature vendor that uses the GPG package for signing and verification.
Supports git config options: - gpg.minTrustLevel: Minimum trust level for signature verification
| Class Method | available |
Check if the gpg Python package is available. |
| Class Method | from |
Create a GPG vendor from git configuration. |
| Method | __init__ |
Initialize the GPG package vendor. |
| Method | sign |
Sign data with a GPG key. |
| Method | verify |
Verify a GPG signature. |
| Instance Variable | min |
Undocumented |
Inherited from SignatureVerifier (via SignatureSigner):
| Instance Variable | keyids |
Undocumented |
Check if the gpg Python package is available.
| Returns | |
bool | True if gpg package can be imported, False otherwise |
Initialize the GPG package vendor.
| Parameters | |
minstr | None | Minimum trust level required (undefined, never, marginal, fully, ultimate). If None, any trust level is accepted. |
keyids:Iterable[ | Optional iterable of trusted GPG key IDs for verification. If provided, only signatures from these keys will be trusted. |
Verify a GPG signature.
| Parameters | |
data:bytes | The data that was signed |
signature:bytes | The signature to verify |
| Raises | |
BadSignature | if GPG signature verification fails |
UntrustedSignature | if the signature was not created by a trusted key or trust level is below minimum |