View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Benjamin Trott > Crypt-OpenPGP-1.06 > Crypt::OpenPGP::Armour



Annotate this POD


New  12
Open  6
Stalled  1
View/Report Bugs
Source   Latest Release: Crypt-OpenPGP-1.12


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


    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;


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.


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:


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.


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

syntax highlighting: