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 πŸŽ€

  • homedir
  • armor
  • textmode
  • default_key
  • no_greeting
  • verbose
  • no_verbose
  • quiet
  • batch
  • always_trust
  • comment
  • status_fd
  • logger_fd
  • passphrase_fd
  • compress_algo
  • force_v3_sigs
  • rfc1991
  • openpgp
  • options
  • no_options
  • encrypt_to
  • recipients

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