class documentation
class X509SignatureVendor(SignatureSigner, SignatureVerifier):
Constructors: X509SignatureVendor.from_config(config, keyids), X509SignatureVendor(gpgsm_command, keyids)
Signature vendor that uses gpgsm (GnuPG for S/MIME) for X.509 signatures.
Supports git config options: - gpg.x509.program: Path to gpgsm command (defaults to 'gpgsm')
| Class Method | available |
Check if the gpgsm command is available. |
| Class Method | from |
Create an X.509 vendor from git configuration. |
| Method | __init__ |
Initialize the X.509 signature vendor. |
| Method | sign |
Sign data with an X.509 certificate using gpgsm. |
| Method | verify |
Verify an X.509 signature using gpgsm. |
| Instance Variable | gpgsm |
Undocumented |
Inherited from SignatureVerifier (via SignatureSigner):
| Instance Variable | keyids |
Undocumented |
Check if the gpgsm command is available.
| Returns | |
bool | True if gpgsm command is in PATH, False otherwise |
overrides
dulwich.signature.SignatureSigner.signSign data with an X.509 certificate using gpgsm.
| Parameters | |
data:bytes | The data to sign |
keyid:str | None | Optional certificate ID to use for signing. If not specified, the default certificate will be used. |
| Returns | |
bytes | The signature as bytes |
| Raises | |
subprocess.CalledProcessError | if gpgsm command fails |
Verify an X.509 signature using gpgsm.
| Parameters | |
data:bytes | The data that was signed |
signature:bytes | The signature to verify |
| Raises | |
BadSignature | if gpgsm signature verification fails |
UntrustedSignature | if signature was not created by a trusted certificate |