pub struct SignatureCheck {
pub signature: Vec<u8>,
pub payload: Vec<u8>,
pub result: char,
pub trust_level: TrustLevel,
pub key: Option<String>,
pub signer: Option<String>,
pub fingerprint: Option<String>,
pub primary_key_fingerprint: Option<String>,
pub output: String,
pub gpg_status: String,
pub verifier_failed: bool,
}Expand description
A parsed signature check result, mirroring Git’s struct signature_check.
Fields§
§signature: Vec<u8>The detached armored signature extracted from the object.
payload: Vec<u8>The signed payload (object with gpgsig header removed).
result: char%G? result: G good, B bad, U good+untrusted, E error,
N no signature, X/Y/R expired/expired-key/revoked.
trust_level: TrustLevel%GT trust level.
key: Option<String>%GK key id.
signer: Option<String>%GS signer (uid).
fingerprint: Option<String>%GF signing key fingerprint.
primary_key_fingerprint: Option<String>%GP primary key fingerprint.
output: StringHuman-readable gpg output (stderr); shown by --show-signature.
gpg_status: StringRaw [GNUPG:] status lines; shown by verify-commit --raw.
verifier_failed: boolTrue when the underlying verifier reported failure regardless of the
parsed %G? result. For ssh this captures Git’s
verify_ssh_signed_buffer return code (e.g. an untrusted key that still
produces a Good "git" signature with ... line must fail verification).
Implementations§
Source§impl SignatureCheck
impl SignatureCheck
Sourcepub fn default_none() -> SignatureCheck
pub fn default_none() -> SignatureCheck
Construct the “no signature” result (%G? -> N).
Sourcepub fn is_good(&self) -> bool
pub fn is_good(&self) -> bool
True when the signature verified as good (G) or good-but-expired-key
(Y) — Git’s success criterion in check_signature.
Sourcepub fn verify_status(&self, min_trust_level: Option<TrustLevel>) -> bool
pub fn verify_status(&self, min_trust_level: Option<TrustLevel>) -> bool
Overall verification result honoring min_trust_level: Ok(()) when the
signature is good and meets the configured minimum trust level.
Trait Implementations§
Source§impl Clone for SignatureCheck
impl Clone for SignatureCheck
Source§fn clone(&self) -> SignatureCheck
fn clone(&self) -> SignatureCheck
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more