Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Crypt::OpenPGP::ArmourUser Contributed Perl DocumentaCrypt::OpenPGP::Armour(3)

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:

       o   Object

	   Specifies the type of object	being armoured;	the string "PGP	" (PGP
	   followed by a space)	will be	prepended to the value you pass	in.

	   This	argument is required.

       o   Data

	   The binary octets to	be encoded as the body of the armoured
	   message; these octets will be encoded into ASCII using
	   MIME::Base64.

	   This	argument is required.

       o   Headers

	   A reference to a hash containing key-value pairs, where the key is
	   the name of the the header and the value the	header value. These
	   headers are placed at the top of the	encoded	message	in the form
	   "Header: Value".

   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.

perl v5.24.1			  2009-12-10	     Crypt::OpenPGP::Armour(3)

NAME | SYNOPSIS | DESCRIPTION | USAGE | AUTHOR & COPYRIGHTS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Crypt::OpenPGP::Armour&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help