Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ICertInit::loadCertFromBuffer2 ( P6VOID pBuffer,
P6UINT32  cBuffer,
P6CRYPTCERTFMT  nFormat,
const P6CHAR pszPassPhrase,
p6ICert **  parCACerts,
P6UINT32  cCACerts,
P6UINT32 pcReturned 
)
pure virtual

This method is used to load certificate(s) from a buffer containing data of the type specified by the nFormat argument.

Only PEM and PKCS12 formatted data can contain more than one certficiate and/or be encrypted. In the case where there is more than one certificate, the subject certificate is loaded into the current instance of p6ICert and the CA certificates are returned in the supplied array in parCACerts.

Parameters
pBuffer[ in ] A pointer to a P6VOID buffer that contains the certificate data.
cBuffer[ in ] A P6UINT32 containing the number of valid bytes of data in pBuffer.
nFormat[ in ] A P6CRYPTCERTFMT value indicating the format of the data in pBuffer.
pszPassPhrase[ in ] (optional) A pointer to a NULL terminated string containing the passphrase needed to decrypt the data in pBuffer.
parCACerts[ out ] (optional) The address of an array of pointers to p6ICert interfaces in which will be placed up to the requested number (specified by cCACerts) of certificate interfaces representing each CA cert in the chain. NULL can be passed to indicate that additional CA certificates should not be loaded even if they exist. If NULL is passed, then cCACerts MUST be zero. CA certificates are returned in the order that they occurin the buffer.
cCACerts[ in ] The number of array entries in parCACerts.
pcReturned[ out ] (optional) The address of a P6UINT32 in which will be returned the number of CA certs placed into parCACerts if it was specified. Or NULL if this information is not needed and/or parCACerts was NULL.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize must be called before this function.
P6R::eInvalidArgpBuffer is equal to NULL, cBuffer is set to zero or parCACerts was not NULL but pcReturned is NULL.
P6R::eFormatnFormat contained an invalid value. See P6R::P6CRYPTCERTFMT.
P6R::eInvalidCertThere was an error loading one the certificates. More information has been logged to the logfile.