Generate an PKCS #12 file given the following components: private key, certificate for the private key, and the certificate chain to the root certificate authority (CA).
- Parameters
-
pszFilename | [ in ] Full path to where to write the ".p12" file (file must be writable). |
pszPassword | [ in ] Define the pass phrase that the user of the ".p12" file needs to unencrypt it. |
pPrivateKey | [ in ] Private key to put into the ".p12" file |
pClientCert | [ in ] The certificate for the private key |
ppCACertsArray | [ in ] A pointer to an array of pointers to p6ICert objects composing the certificate chain to the root CA. |
caCount | [ in ] The number of entries in the ppCACertsArray |
pOptions | [ in ] (optional can be NULL) allows the caller to fine tune the PKCS #12 file |
- Returns
Failure | P6R::eNotInitialized | A successful call to initialize() is required. |
P6R::eWrongKeyType | pClientCert is not the cert for the pPrivateKey parameter. |
P6R::eInvalidArg | pszFilename, pszPassword, pPrivateKey, or pClientCert is NULL. |
P6R::eNoMemory | Failed to create internal data structures to create the pkcs12 file. |
P6R::eAccess | Could not create or write to pszFilename |