PKCS12_parse.pod revision 344604
1=pod 2 3=head1 NAME 4 5PKCS12_parse - parse a PKCS#12 structure 6 7=head1 SYNOPSIS 8 9 #include <openssl/pkcs12.h> 10 11 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, 12 STACK_OF(X509) **ca); 13 14=head1 DESCRIPTION 15 16PKCS12_parse() parses a PKCS12 structure. 17 18B<p12> is the B<PKCS12> structure to parse. B<pass> is the passphrase to use. 19If successful the private key will be written to B<*pkey>, the corresponding 20certificate to B<*cert> and any additional certificates to B<*ca>. 21 22=head1 NOTES 23 24The parameters B<pkey> and B<cert> cannot be B<NULL>. B<ca> can be <NULL> in 25which case additional certificates will be discarded. B<*ca> can also be a 26valid STACK in which case additional certificates are appended to B<*ca>. If 27B<*ca> is B<NULL> a new STACK will be allocated. 28 29The B<friendlyName> and B<localKeyID> attributes (if present) on each 30certificate will be stored in the B<alias> and B<keyid> attributes of the 31B<X509> structure. 32 33=head1 RETURN VALUES 34 35PKCS12_parse() returns 1 for success and zero if an error occurred. 36 37The error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)> 38 39=head1 BUGS 40 41Only a single private key and corresponding certificate is returned by this 42function. More complex PKCS#12 files with multiple private keys will only 43return the first match. 44 45Only B<friendlyName> and B<localKeyID> attributes are currently stored in 46certificates. Other attributes are discarded. 47 48Attributes currently cannot be stored in the private key B<EVP_PKEY> structure. 49 50=head1 SEE ALSO 51 52L<d2i_PKCS12(3)|d2i_PKCS12(3)> 53 54=head1 HISTORY 55 56PKCS12_parse was added in OpenSSL 0.9.3 57 58=cut 59