GnuPG::Signature(3pm)

πŸ’œ GnuPG::Signature(3pm) β€” the glow-up

okay bestie, so this is the Perl doc for GnuPG::Signature, part of the User Contributed Perl Documentation for GnuPG. it's the little object that holds ✨vibes✨ about a GnuPG key signature. buckle up, it's short but it's iconic.


🌸 NAME 🌸

GnuPG::Signature β€” GnuPG Key Signature Objects. that's it, that's the whole name. πŸŽ€


⭐ SYNOPSIS ⭐

# assumes a GnuPG::Key or GnuPG::UserID or GnuPG::UserAttribute object in $signed
my $signing_id = $signed->signatures->[0]->hex_id();

so like, you've got one of those in $signed, and you just reach in and grab the hex id of the first signature. no big deal. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so GnuPG::Signature objects are literally not meant to be made on their own β€” they get created as part of GnuPG::Key objects. they embody (love that word) the various aspects of a GnuPG signature on a key. main character energy, but as a data member. πŸ‘‘


✨ OBJECT METHODS ✨

  • new( %initialization_args ) β€” this method creates a brand new object for you 🫢. the arguments are optional and they're just initialization of data members. no stress.
  • is_valid() β€” returns 1 if GnuPG was actually able to cryptographically verify the signature, otherwise 0. like a vibe check but for crypto. 😭
  • compare( $other ) β€” returns non-zero only when this Signature is identical to the other GnuPG::Signature. literally twin flames or nothing. no partial credit. πŸ’€

🌈 OBJECT DATA MEMBERS 🌈

  • validity β€” a character indicating the cryptographic validity of the key. GnuPG uses at least these characters:
    • "!" means valid πŸ’–
    • "-" means not valid πŸ™ˆ
    • "?" means unknown (e.g. if the supposed signing key is not present in the local keyring)
    • "%" means an error occurred (e.g. a non-supported algorithm) 🚨

see the documentation for --check-sigs in gpg(1). iykyk.

  • algo_num β€” the number of the algorithm used for the signature πŸ”’.
  • hex_id β€” the hex id of the signing key πŸ”‘.
  • user_id_string β€” the first user id string on the key that made the signature. lowkey important caveat: this may not be defined if the signing key is not on the local keyring.
  • sig_class β€” the signature class. this is the numeric value of the class of signature.

a table of possible classes of signatures and their numeric types can be found at http://tools.ietf.org/html/rfc4880#section-5.2.1 β€” go read it, it's giving reference material πŸ“š

  • is_exportable β€” returns 0 for local-only signatures, non-zero for exportable signatures 🧳✨
  • date_string β€” the formatted date the signature was performed on πŸ—“οΈ
  • date β€” the date the signature was performed, represented as the number of seconds since midnight 1970-01-01 UTC ⏰
  • expiration_date_string β€” the formatted date the signature will expire (signatures without expiration return undef) πŸ‚
  • expiration_date β€” the date the signature will expire, represented as the number of seconds since midnight 1970-01-01 UTC (signatures without expiration return undef) βŒ›

πŸ‘‘ SEE ALSO πŸ‘‘

that's literally it for cross-references, bestie. the section's just vibes. ✨


ngl the whole thing is short but it ate. remember: every one of those undef returns and every one of those validity characters matters, no cap. πŸ”₯

~~ sign-off ~~ this little gem is perl v5.40.1, dated 2025-03-14, and it lives at GnuPG::Signature(3pm) β€” go forth and verify some sigs, you absolute icon πŸ«ΆπŸ’œβœ¨

πŸ“¦ where this page comes from