NAME

Mail::GPG::Result - Mail::GPG decryption and verification results

SYNOPSIS

$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;
$trust               = $result->get_enc_trust;
$encryption_mail     = $result->get_enc_mail;

$signed              = $result->get_is_signed;
$signature_ok        = $result->get_sign_ok;
$signed_key          = $result->get_sign_key_id;
$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;
$gpg_exit_code       = $result->get_gpg_rc;

DESCRIPTION

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.

ATTRIBUTES

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.

is_encrypted

Indicates whether an entity was encrypted or not.

enc_ok

Indicates whether decryption of an entity was successful or not.

enc_key_id

The key ID of the sender who encrypted an entity.

sign_trust

Returns how much you trust the encrypter's key. Refer to Mail::GPG->get_key_trust for a list of known levels and their meaning.

enc_mail

The mail address of the sender who encrypted an entity.

is_signed

Indicates whether an entity was signed or not.

sign_ok

Indicates whether the signature could be verified successfully or not.

sign_key_id

The key ID of the sender who signed an entity.

sign_trust

Returns how much you trust the signers key. Refer to Mail::GPG->get_key_trust for a list of known levels and their meaning.

sign_mail

The primary mail address of the sender who signed an entity.

sign_mail_aliases

A reference to a list of the signer's mail alias addresses.

gpg_stdout

This is reference to a scalar containing gpg's STDOUT output.

gpg_stderr

This is reference to a scalar containing gpg's STDERR output.

gpg_rc

Exit code of the gpg program.

METHODS

There are only two methods, both are for debugging purposes:

as_string

$string = $result->as_string ( no_stdout => $no_stdout )

Returns a printable string version of the object.

no_stdout

If this option is set, gpg's stdout is ommitted in the string represenation.

as_short_string

$short_string = $result->as_short_string;

Returns a very short string representation, without any gpg output, arranged in one line.

AUTHOR

Joern Reder <joern AT zyn.de>

COPYRIGHT

Copyright (C) 2004 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.

SEE ALSO

Mail::GPG, perl(1).