Crypt::OpenSSL::PKCS12 - Perl extension to OpenSSL's PKCS12 API.
use Crypt::OpenSSL::PKCS12; my $pass = "your password"; my $pkcs12 = Crypt::OpenSSL::PKCS12->new_from_file('cert.p12'); print $pkcs12->certificate($pass); if ($pkcs12->mac_ok($pass)) { .... $pkcs12->create('test-cert.pem', 'test-key.pem', $pass, 'out.p12', "friendly name");
This implements a small bit of OpenSSL's PKCS12 API.
new( )
new_from_string( $string )
new_from_file( $filename )
Create a new Crypt::OpenSSL::PKCS12 instance.
certificate( [$pass] )
Get the Base64 representation of the certificate.
as_string( [$pass] )
Get the binary represenation as a string.
mac_ok( [$pass] )
Verifiy the certificates Message Authentication Code
changepass( $old, $new )
Change a certificate's password.
create( $cert, $key, $pass, $output_file, $friendly_name )
Create a new PKCS12 certificate. $cert & $key may either be strings or filenames.
$friendly_name is optional.
None by default.
On request:
NOKEYS
NOCERTS
INFO
CLCERTS
CACERTS
OpenSSL(1), Crypt::OpenSSL::X509, Crypt::OpenSSL::RSA, Crypt::OpenSSL::Bignum
Dan Sully, <daniel@cpan.org>
Copyright 2004-2008 by Dan Sully
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Crypt::OpenSSL::PKCS12, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::OpenSSL::PKCS12
CPAN shell
perl -MCPAN -e shell install Crypt::OpenSSL::PKCS12
For more information on module installation, please visit the detailed CPAN module installation guide.