Can anybody tell me how to use
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);
any documenatation reference will also work.
Can anybody tell me how to use
PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);
any documenatation reference will also work.
Without error-checking:
The private key is now in
pkey
, the certificate inx509_cert
and any additional certificates inadditional_certs
.From Apple's site, here are the descriptions:
This function takes a PKCS12 structure and a password (ASCII, null terminated) and returns the private key, the corresponding certificate and any CA certificates. If any of these is not required it can be passed as a NULL. The 'ca' parameter should be either NULL, a pointer to NULL or a valid STACK structure. Typically to read in a PKCS#12 file you might do: