Clarification on getting a validity reason in GPGME

John Scott jscott at posteo.net
Sun Nov 8 02:27:57 CET 2020


Hi

I'm writing a tool using GPGSM and want to print signature validation 
information without reinventing the wheel with case statements, also for the 
sake of localization. These members in gpgme_signature_t [1] seem to be what 
I'm looking for:

gpgme_validity_t validity
	The validity of the signature.
gpgme_error_t validity_reason
	If a signature is not valid, this provides a reason why.

so I can get a string from the gpgme_error_t, although it appears to be 
conditional on the signature being invalid. That's not clear since 
gpgme_validity_t is an enumeration of
GPGME_VALIDITY_{UNKNOWN, UNDEFINED, NEVER, MARGINAL,FULL, ULTIMATE}

I wonder if this is the case already and it's just a documentation quirk, but 
it'd be helpful if validity_reason were set to some value for good signatures, 
although this isn't technically an error.

[1] https://www.gnupg.org/documentation/manuals/gpgme/Verify.html#Verify
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20201107/83e4748c/attachment.sig>


More information about the Gnupg-users mailing list