Convert::PEM 0.07 review

Download
by rbytes.net on

Convert::PEM is Perl module that read/write encrypted ASN.1 PEM files. SYNOPSIS use Convert::PEM; my $pem = Convert::P

License: Perl Artistic License
File size: 20K
Developer: Benjamin Trott
0 stars award from rbytes.net

Convert::PEM is Perl module that read/write encrypted ASN.1 PEM files.

SYNOPSIS

use Convert::PEM;
my $pem = Convert::PEM->new(
Name => "DSA PRIVATE KEY",
ASN => qq(
DSAPrivateKey SEQUENCE {
version INTEGER,
p INTEGER,
q INTEGER,
g INTEGER,
pub_key INTEGER,
priv_key INTEGER
}
));

my $pkey = $pem->read(
Filename => $keyfile,
Password => $pwd
);

$pem->write(
Content => $pkey,
Password => $pwd,
Filename => $keyfile
);

Convert::PEM reads and writes PEM files containing ASN.1-encoded objects. The files can optionally be encrypted using a symmetric cipher algorithm, such as 3DES. An unencrypted PEM file might look something like this:

-----BEGIN DH PARAMETERS-----
MB4CGQDUoLoCULb9LsYm5+/WN992xxbiLQlEuIsCAQM=
-----END DH PARAMETERS-----

The string beginning MB4C... is the Base64-encoded, ASN.1-encoded "object."
An encrypted file would have headers describing the type of encryption used, and the initialization vector:

-----BEGIN DH PARAMETERS-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,C814158661DC1449

AFAZFbnQNrGjZJ/ZemdVSoZa3HWujxZuvBHzHNoesxeyqqidFvnydA==
-----END DH PARAMETERS-----

The two headers (Proc-Type and DEK-Info) indicate information about the type of encryption used, and the string starting with AFAZ... is the Base64-encoded, encrypted, ASN.1-encoded contents of this "object."

The initialization vector (C814158661DC1449) is chosen randomly.

Requirements:
Perl

Convert::PEM 0.07 keywords