Mail::GPG::Result - Mail::GPG decryption and verification results
$result = $mg->verify ( entity => $entity ); ($decrypted_entity, $result) = $mg->decrypt ( entity => $entity, ); $long_string = $result->as_string ( ... ); $short_string = $result->as_short_string; $encrypted = $result->get_is_encrypted; $decryption_ok = $result->get_enc_ok; $encryption_key_id = $result->get_enc_key_id; $encryption_mail = $result->get_enc_mail; $enc_key_ids = $result->get_enc_key_ids; $enc_mails = $result->get_enc_mails; $signed = $result->get_is_signed; $signature_ok = $result->get_sign_ok; $signed_key = $result->get_sign_key_id; $signed_fingerprint = $result->get_sign_fingerprint; $trust = $result->get_sign_trust; $signed_mail = $result->get_sign_mail; $signed_mail_aliases = $result->get_sign_mail_aliases; $stdout_sref = $result->get_gpg_stdout; $stderr_sref = $result->get_gpg_stderr; $status_sref = $result->get_gpg_status; $gpg_exit_code = $result->get_gpg_rc;
This class encapsulates decryption and verification results of Mail::GPG. You never create objects of this class yourself, they're all returned by Mail::GPG.
This class mainly has a bunch of attributes which reflect the result of a Mail::GPG operation. You can read these attributes with get_attribute.
Indicates whether an entity was encrypted or not.
Indicates whether decryption of an entity was successful or not.
The recipient's key id of an encrypted mail. This is the first key reported by gnupg in case the mail has more than one recipient.
The recipient's mail address of an encrypted mail. This is the first mail address reported by gnupg in case the mail has more than one recipient.
This is an array reference of key ids in case the mail is encrypted for several recipients.
This is an array reference of the correspondent recipient mail adresses. Entries may be empty, if gnugpg didn't report the mail address for a specific key.
Indicates whether an entity was signed or not.
Indicates whether the signature could be verified successfully or not.
Gives more details about the signature status. May have one of the following valufes: GOOD, EXP, EXPKEY, REVKEY and BAD. Please refer to gnupg's DETAILS file for details about the meaning of these values.
The key ID of the sender who signed an entity.
Key fingerprint of the sender who signed an entity.
Returns how much you trust the signers key. Refer to Mail::GPG->get_key_trust for a list of known levels and their meaning.
The primary mail address of the sender who signed an entity.
A reference to a list of the signer's mail alias addresses.
This is reference to a scalar containing gpg's STDOUT output.
This is reference to a scalar containing gpg's STDERR output.
Exit code of the gpg program. Don't rely on this, use the other attributes to check wether operation was successful resp. a verification went ok.
There are only two methods, both are for debugging purposes:
$string = $result->as_string ( no_stdout => $no_stdout )
Returns a printable string version of the object.
If this option is set, gpg's stdout is ommitted in the string represenation.
$short_string = $result->as_short_string;
Returns a very short string representation, without any gpg output, arranged in one line.
Joern Reder <joern AT zyn.de>
Copyright (C) 2004-2006 by Joern Reder, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.