GnuPG::Options(3pm)
π GnuPG::Options(3pm) β bestie edition π
Okay so first things first: this is the GnuPG::Options(3pm) page, part of the User Contributed Perl Documentation crew, and it's literally just about holding all your GnuPG option vibes in one object. Buckle up π
β¨ NAME β¨
GnuPG::Options β the whole entire embodiment of GnuPG options, no cap π
πΈ SYNOPSIS πΈ
# assuming $gnupg is a GnuPG::Interface object
$gnupg->options->armor( 1 );
$gnupg->options->push_recipients( 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' );
Like, that's it. That's the whole vibe check π¦
π DESCRIPTION π
So GnuPG::Options objects are generally not instantiated on their own, periodt. They show up as part of a GnuPG::Interface object instead. Think of it as the sidekick, not the main character π«
π OBJECT METHODS π
new( %initialization_args )
This method creates a brand new object, slay β¨ The optional arguments? They're just initialization of data members. Easy.
hash_init( %args ).
(Yeah, it's just chillin' there with a period. Iconic.)
copy
Returns a copy of this object. Super useful for "saving" your options, iykyk πΎ
get_args
Returns a list of arguments to be passed to GnuPG, and it builds that list based on your data members in this exact order: first the meta_ options, then the regular options, then extra_args. Order matters bestie, don't come for me π₯
π OBJECT DATA MEMBERS π
homedirarmortextmodedefault_keyno_greetingverboseno_verbosequietbatchalways_trustcommentstatus_fdlogger_fdpassphrase_fdcompress_algoforce_v3_sigsrfc1991openpgpoptionsno_optionsencrypt_torecipients
These options correlate directly to many GnuPG options, fr fr. Here's how the translation works:
- For those that are boolean to GnuPG, simply that argument is passed.
- For those that are associated with a scalar, that scalar is passed passed as an argument appropriate. (Yes, "passed passed" β the original said it, I'm not touching it, I don't make the rules π)
- For those that can be specified more than once, such as
recipients, those are considered lists and passed accordingly.
Each one of these is undefined or false to begin. Clean slate energy β¨
π¦ Meta Options π¦
Okay so meta options are the special ones. They don't correlate directly to any option in GnuPG β instead they're generally a bundle of options used to accomplish a specific goal, like obtaining compatibility with PGP 5. So the actual arguments each of these reflects may change with time. Each defaults to false unless otherwise specified. Lowkey shapeshifters π
These options are being designed and to provide a non-GnuPG-specific abstraction, to help create compatibility with a possible PGP::Interface module. (Again β "designed and to provide" is exactly what it says. Love that for us π)
And to help avoid confusion, methods that take a form of a key as an object shall be prepended with _id(s) if they only take an id; otherwise assume an object of type GnuPG::Key is required. Naming conventions are self care π«Ά
meta_pgp_5_compatible
If true, arguments are generated to try to be compatible with PGP 5.x.
meta_pgp_2_compatible
If true, arguments are generated to try to be compatible with PGP 2.x.
meta_interactive
If false, arguments are generated to try to help the using program use GnuPG in a non-interactive environment, such as CGI scripts. Default is true β so heads up, this one's flipped compared to the rest π
meta_signing_key_id
This scalar reflects the key used to sign messages. Currently this is synonymous with default-key.
meta_signing_key
This GnuPG::Key object reflects the key used to sign messages.
meta_recipients_key_ids
This list of scalar key ids are used to generate the appropriate arguments having these keys as recipients.
meta_recipients_keys
This list of keys of the type GnuPG::Key are used to generate the appropriate arguments having these keys as recipients. You probably want to have this list be of the inherited class GnuPG::SubKey, as in most instances, OpenPGP keypairs have the encryption key as the subkey of the primary key, which is used for signing. Genuinely important detail, don't skip it π
π Other Data Members π
extra_args
This is a list of any other arguments used to pass to GnuPG. Useful to pass an argument not yet covered in this package. It's the "misc" folder of this module, bestie ποΈ
β SEE ALSO β
GnuPG::Interface
Okay so real talk β this page is mad short but every single flag matters, so if you're skimming, don't. Go back up. I'll wait π
That's the whole page, you ate that π And for the credits: this lovely thing came from perl v5.40.1, dated 2025-03-14. Stay slay, stay armored πβ¨
π¦ 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