Crypt::OpenPGP::Armour - ASCII Armouring and Unarmouring


NAME

Crypt::OpenPGP::Armour - ASCII Armouring and Unarmouring


SYNOPSIS

    use Crypt::OpenPGP::Armour;
    my $armoured = Crypt::OpenPGP::Armour->armour(
                           Data => "foo bar baz",
                           Object => "FOO OBJECT",
                           Headers => {
                                         Version => '0.57',
                                         Comment => 'FooBar',
                                      },
                     );
    my $decoded = Crypt::OpenPGP::Armour->unarmour( $armoured ) or
        die Crypt::OpenPGP::Armour->errstr;


DESCRIPTION

This module converts arbitrary-length strings of binary octets into Base64-encoded ASCII messages suitable for transfer as text. It also converts in the opposite direction, taking an armoured message and returning the binary data, along with headers.


USAGE

Crypt::OpenPGP::Armour->armour( %args )

Converts arbitrary-length strings of binary octets in an encoded message containing 4 parts: head and tail markers that identify the type of content contained therein; a group of newline-separated headers at the top of the message; Base64-encoded data; and a Base64-encoded CRC24 checksum of the message body.

Returns undef on failure, the encoded message on success. In the case of failure call the class method errstr to get the error message.

%args can contain:

Crypt::OpenPGP::Armour->unarmour($message)

Decodes an ASCII-armoured message and returns a hash reference whose keys are the arguments provided to armour, above. Returns undef on failure (for example, if the checksum fails to match, or if the message is in an incomprehensible format). In case of failure call the class method errstr to get the text of the error message.


AUTHOR & COPYRIGHTS

Please see the Crypt::OpenPGP manpage for author, copyright, and license information.

 Crypt::OpenPGP::Armour - ASCII Armouring and Unarmouring