NSSLExportInternalClientCertificate

Syntax

#include <cafe.h>
#include <cafe/nssl/nsslclient.h>

NSSL_RVAL NSSLExportInternalClientCertificate(NSSLClientCertID id,
                                              char* pCertBuf,
                                              int *pCertBufSize,
                                              NSSLCertType *pCertType,
                                              char* pPvtKeyBuf,
                                              int *pPvtKeyBufSize,
                                              NSSLPrivKeyType *pPvtKeyType);

Parameters

id ID of the certificate to be exported.
pCertBuf Pointer to buffer where the certificate data is to be exported. Has to be aligned to PPC IPC cache boundary
pCertBufSize Pointer to hold size of pCertBuf. The caller should provide allocated size of pCertBuf, on return it will contain the size of pCertBuf filled with the certificate data.
pCertType Pointer to hold the type of certificate (currently only NSSL_CERT_TYPE_DER is supported).
pPvtKeyBuf Pointer to buffer where the private key data is to be exported. Has to be aligned to PPC IPC cache boundary.
pPvtKeyBufSize Pointer to hold size of pPvtKeyBuf. The caller should provide allocated size of pPvtKeyBuf, on return it will contain the size of pPvtKeyBuf filled with the private key data.
pPvtKeyType Pointer to hold the type of private key (currently only NSSL_PRIV_KEY_TYPE_RSA is supported and the RSA key is exported in DER format).

Return Values

NSSL_RVAL_OK on success, error code of type NSSL_RVAL on failure.

Description

Exports the specified internal client certificate (if the certificate is 'exportable').

NOTE:
Access to the individual built-in certificate is restricted based on capabilities of the application. NSSL_RVAL_CERT_NO_ACCESS is returned if application tries to use a certificate for which it does not have access permission. NSSL_RVAL_CERT_NOT_EXPORTALE is returned if the certificate is not 'exportable'.

Pass pCertBuf = NULL and *pCertBufSize = 0 to get size of the certificate data in pCertBufSize.

Pass pPvtKeyBuf = NULL and *pPvtKeyBufSize = 0 to get size of the private key data in pPvtKeyBufSize.

Do Not Call From

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

See Also

NSSLExportInternalServerCertificate

Revision History

2012/08/08 Initial version.


CONFIDENTIAL