GnuPG::Key(3pm)
πΈ NAME πΈ
okay bestie, this is GnuPG::Key(3pm) from the User Contributed Perl Documentation zone, and the name of the game is GnuPG::Key β GnuPG Key Object. That's the whole vibe: a GnuPG key object, periodt. π
π SYNOPSIS π
# assumes a GnuPG::Interface object in $gnupg
my @keys = $gnupg->get_public_keys( 'ftobin' );
# now GnuPG::PublicKey objects are in @keys
β¨ DESCRIPTION β¨
Okay so real talk: GnuPG::Key objects are generally not instantiated on their own. They're used as a superclass of GnuPG::PublicKey, GnuPG::SecretKey, or GnuPG::SubKey objects. It's giving backstage main-character superclass energy, not solo debut. π«Ά
π OBJECT METHODS π
π§ Initialization Methods π§
new( %initialization_args )β creates a new object. The optional arguments are initialization of data members. Slay, constructor.hash_init( %args )β the page lists this signature, and that's the tea we get here; no extra description is provided. π΅
And the same OBJECT METHODS section keeps rolling with these method besties:
short_hex_idβ returns the commonly-used short, 8 character short hex id of the key. Eight characters, iconic.compare( $other, $deep )β returns non-zero only when this Key is identical to the otherGnuPG::Key. If$deepis present and non-zero, the key's associated signatures, revocations, and revokers will also be compared. Deep comparison, no cap. π₯
π OBJECT DATA MEMBERS π
lengthβ number of bits in the key.algo_numβ the algorithm number that the Key is used for.usage_flagsβ the Key Usage flags associated with this key, represented as a string of lower-case letters. Possible values include: (a) authenticate, (c) certify, (e) encrypt, and (s) sign.
A key may have any combination of them in any order. In addition to these letters, the primary key has uppercase versions of the letters to denote the usable capabilities of the entire key, and a potential letter D to indicate a disabled key.
See "key capabilities" DETAILS from the GnuPG sources for more details.
hex_dataβ the data of the key. WARNING: this seems to have never been instantiated, and should always be undef. πpubkey_dataβ a list ofMath::BigIntobjects that correspond to the public key material for the given key. This member is empty on secret keys in GnuPG 1.4. It is populated on secret keys In GnuPG >= 2.2.0.
For DSA keys, the values are: prime (p), group order (q), group generator (g), y.
For RSA keys, the values are: modulus (n), exponent (e).
For El Gamal keys, the values are: prime (p), group generator (g), y.
For more details, see: http://tools.ietf.org/html/rfc4880#page-42
hex_idβ the long hex id of the key. This is not the fingerprint nor the short hex id, which is 8 hex characters.creation_date_string,expiration_date_stringβ formatted date of the key's creation and expiration. If the key has no expiration,expiration_date_stringwill return undef.creation_date,expiration_dateβ date of the key's creation and expiration, stored as the number of seconds since midnight 1970-01-01 UTC. If the key has no expiration,expiration_datewill return undef.fingerprintβ aGnuPG::Fingerprintobject.signaturesβ a list ofGnuPG::Signatureobjects embodying the signatures on this key. For subkeys, the signatures are usually subkey-binding signatures. For primary keys, the signatures are statements about the key itself.revocationsβ a list of revocations associated with this key, stored asGnuPG::Signatureobjects (since revocations are a type of certification as well). Note that a revocation of a primary key has a different semantic meaning than a revocation associated with a subkey.revokersβ a list ofGnuPG::Revokerobjects associated with this key, indicating other keys which are allowed to revoke certifications made by this key.
π SEE ALSO π
GnuPG::Fingerprint, GnuPG::Signature, GnuPG::Revoker, β yes, that trailing comma is in the house. π
This lil page is from perl v5.40.1, dated 2025-03-14, and it's GnuPG::Key(3pm) β mwah πβ¨
π¦ where this page comes from
- debian trixie: libgnupg-interface-perl 1.04-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgnupg-interface-perl 1.04-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgnupg-interface-perl 1.04-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms