Mail::Ezmlm::GpgKeyRing - Object Methods for gnupg keyring management


 use Mail::Ezmlm::GpgKeyRing;
 $keyring = new Mail::Ezmlm::GpgKeyRing(DIRNAME);

The rest is a bit complicated for a Synopsis, see the description.


Mail::Ezmlm::GpgKeyRing is a Perl module that is designed to provide an object interface to GnuPG keyrings for encrypted mailing lists.

Setting up a new Mail::Ezmlm::GpgKeyRing object:

   use Mail::Ezmlm::GpgKeyRing;
   $keyring = new Mail::Ezmlm::GpgKeyRing('/home/user/lists/foolist/.gnupg');

new() returns the new instance for success, undefined if there was a problem.

Determining the location of the configured keyring.

   $whichkeyring = $keyring->get_location();
   print $keyring->get_location();

Changing which keyring the Mail::Ezmlm::GpgKeyRing object points at:


Export a key:

You may export public keys of the keyring.

The key can be identified by its id or other (unique) patterns (like the gnupg program).


The return value is a string containing the ascii armored key data.

Import a key:

You can import public or secret keys into the keyring.

The key should be ascii armored.


Delete a key:

Remove a public key (and the matching secret key if it exists) from the keyring.

The argument is the id of the key or any other unique pattern.


Generate a new key:

        $keyring->generate_key($name, $comment, $email_address, $keysize, $expire);

Refer to the documentation of gnupg for the format of the arguments.

Getting public keys:

Return an array of key hashes each containing the following elements:

  • name

  • email

  • id

  • expires



 Lars Kruse <>


 There are no known bugs.

 Please report bugs to the author or use the bug tracking system at


 gnupg(7), gpg(1), gpg2(1), Crypt::GPG(3pm)