.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PKCS12 3pm" .TH PKCS12 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Crypt::OpenSSL::PKCS12 \- Perl extension to OpenSSL's PKCS12 API. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Crypt::OpenSSL::PKCS12; \& \& my $pass = "your password"; \& my $pkcs12 = Crypt::OpenSSL::PKCS12\->new_from_file(\*(Aqcert.p12\*(Aq); \& \& print $pkcs12\->certificate($pass); \& print $pkcs12\->private_key($pass); \& \& if ($pkcs12\->mac_ok($pass)) { \& ... \& \& # Creating a file \& $pkcs12\->create(\*(Aqtest\-cert.pem\*(Aq, \*(Aqtest\-key.pem\*(Aq, $pass, \*(Aqout.p12\*(Aq, \*(Aqfriendly name\*(Aq); \& \& \& # Creating a string \& my $pksc12_data = $pkcs12\->create_as_string(\*(Aqtest\-cert.pem\*(Aq, \*(Aqtest\-key.pem\*(Aq, $pass, \*(Aqfriendly name\*(Aq); .Ve .SH VERSION .IX Header "VERSION" This documentation describes version 1.9 .SH DESCRIPTION .IX Header "DESCRIPTION" PKCS12 is a file format for storing cryptography objects as a single file or string. PKCS12 is commonly used to bundle a private key with its X.509 certificate or to bundle all the members of a chain of trust. .PP This distribution implements a subset of OpenSSL's PKCS12 API. .SH SUBROUTINES/METHODS .IX Header "SUBROUTINES/METHODS" .IP \(bu 4 new( ) .IP \(bu 4 new_from_string( \f(CW$string\fR ) .IP \(bu 4 new_from_file( \f(CW$filename\fR ) .Sp Create a new Crypt::OpenSSL::PKCS12 instance. .IP \(bu 4 certificate( [\f(CW$pass\fR] ) .Sp Get the Base64 representation of the certificate. .IP \(bu 4 private_key( [\f(CW$pass\fR] ) .Sp Get the Base64 representation of the private key. .IP \(bu 4 as_string( [\f(CW$pass\fR] ) .Sp Get the binary represenation as a string. .IP \(bu 4 mac_ok( [\f(CW$pass\fR] ) .Sp Verifiy the certificates Message Authentication Code .IP \(bu 4 changepass( \f(CW$old\fR, \f(CW$new\fR ) .Sp Change a certificate's password. .IP \(bu 4 create( \f(CW$cert\fR, \f(CW$key\fR, \f(CW$pass\fR, \f(CW$output_file\fR, \f(CW$friendly_name\fR ) .Sp Create a new PKCS12 certificate. \f(CW$cert\fR & \f(CW$key\fR may either be strings or filenames. .Sp \&\f(CW$friendly_name\fR is optional. .IP \(bu 4 create_as_string( \f(CW$cert\fR, \f(CW$key\fR, \f(CW$pass\fR, \f(CW$friendly_name\fR ) .Sp Create a new PKCS12 certificate string. \f(CW$cert\fR & \f(CW$key\fR may either be strings or filenames. .Sp \&\f(CW$friendly_name\fR is optional. .Sp Returns a string holding the PKCS12 certicate. .SH EXPORTS .IX Header "EXPORTS" None by default. .PP On request: .IP \(bu 4 \&\f(CW\*(C`NOKEYS\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`NOCERTS\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`INFO\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`CLCERTS\*(C'\fR .IP \(bu 4 \&\f(CW\*(C`CACERTS\*(C'\fR .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" No diagnostics are documented at this time .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" No special environment or configuration is required. .SH DEPENDENCIES .IX Header "DEPENDENCIES" This distribution has the following dependencies .IP \(bu 4 An installation of OpenSSL, version 1.X.X .IP \(bu 4 Perl 5.8 .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 \&\fBOpenSSL\fR\|(1) (HTTP version with OpenSSL.org ) .IP \(bu 4 Crypt::OpenSSL::X509 .IP \(bu 4 Crypt::OpenSSL::RSA .IP \(bu 4 Crypt::OpenSSL::Bignum .IP \(bu 4 OpenSSL.org .IP \(bu 4 Wikipedia: PKCS12 .IP \(bu 4 RFC:7292: "PKCS #12: Personal Information Exchange Syntax v1.1" .SH INCOMPATIBILITIES .IX Header "INCOMPATIBILITIES" Currently the library only supports OpenSSL 1.X.X .PP The library has not been tested with OpenSSL 3.X.X and is not expected to work with this version at this time .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" Please see the GitHub repository for known issues. .SH AUTHOR .IX Header "AUTHOR" .IP \(bu 4 Dan Sully, .PP Current maintainer .IP \(bu 4 jonasbn .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" In alphabetical order, contributors, bug reporters and all .IP \(bu 4 \&\f(CW@mmuehlenhoff\fR .IP \(bu 4 \&\f(CW@sectokia\fR .IP \(bu 4 \&\f(CW@SmartCodeMaker\fR .IP \(bu 4 Alexandr Ciornii, \f(CW@chorny\fR .IP \(bu 4 Christopher Hoskin, \f(CW@mans0954\fR .IP \(bu 4 Daisuke Murase, \f(CW@typester\fR .IP \(bu 4 Darko Prelec, \f(CW@dprelec\fR .IP \(bu 4 David Steinbrunner, \f(CW@dsteinbrunner\fR .IP \(bu 4 Giuseppe Di Terlizzi, \f(CW@giterlizzi\fR .IP \(bu 4 H.Merijn Brand, \f(CW@tux\fR .IP \(bu 4 Hakim, \f(CW@osfameron\fR .IP \(bu 4 J. Nick Koston, \f(CW@bdraco\fR .IP \(bu 4 James Rouzier, \f(CW@jrouzierinverse\fR .IP \(bu 4 jonasbn. \f(CW@jonasbn\fR .IP \(bu 4 Kelson, \f(CW@kelson42\fR .IP \(bu 4 Lance Wicks, \f(CW@lancew\fR .IP \(bu 4 Leonid Antonenkov .IP \(bu 4 Masayuki Matsuki, \f(CW@songmu\fR .IP \(bu 4 Mikołaj Zalewski .IP \(bu 4 Shoichi Kaji .IP \(bu 4 Slaven Rezić .IP \(bu 4 Todd Rinaldo, \f(CW@toddr\fR .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2004\-2021 by Dan Sully .PP 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.