From the Apple website, here are descriptions:
int PKCS12_parse(PKCS12 *p12, char *pass, EVP_PKEY **pkey, X509 **cert, STACK **ca);
This function takes a PKCS12 structure and password (ASCII, null termination) and returns the private key, the corresponding certificate, and any CA certificates. If any of them is not required, it can be passed as NULL. The "ca" parameter must be either NULL, or a pointer to NULL, or a valid STACK composition. Typically, for reading in a PKCS # 12 file, you can:
p12 = d2i_PKCS12_fp(fp, NULL); PKCS12_parse(p12, password, &pkey, &cert, NULL); PKCS12_free(p12);
source share