NAME

PGP::Mail - Signature checking for PGP-signed mail messages

SYNOPSIS

use PGP::Mail;
my $pgpmail=new PGP::Mail($mail, {default-keyring=>"kr.gpg"});
$status=$pgpmail->status();
$keyid=$pgpmail->keyid();
$data=$pgpmail->data();

DESCRIPTION

This module operates on PGP-signed mail messages. It checks the signature of either a standard clearsigned, a signed message or a PGP/MIME style message.

It returns an object which can be used to check what the signed data was, whether the signature verification succeeded, and what keyid did the signature.

my $pgpmail=new PGP::Mail($mesg, $args);

Creates a new PGP::Mail object using the RFC2822 message specified in $mesg. It will do the signature verification itself. $args is a hashref which gets passed to GnuPG::Interface's options. It is particularly worth looking at GnuPG::Options for this.

$pgpmail->status();

Returns the status of the signature verification (currently good, bad or unverified).

$pgpmail->keyid();

Returns the keyid of this signature, in the format "0x64-bit_key_id".

$pgpmail->data();

Returns the signed data, run through MIME::Parser if necessary.

BUGS

The style of this module leaves quite a bit to be desired, and it only supports verifying signatures at the moment, rather than the full encryption, decryptions, and creating the messages.

AUTHOR

Matthew Byng-Maddick <mbm@colondot.net>

SEE ALSO

perl, GnuPG::Interface, GnuPG::Options, MIME::Tools.