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

NSSL_RVAL NSSLGetPeerCert(NSSLConnectionHandle connection,
                            unsigned char* pCertBuff,
                            int *pCertBuffLen);


connection A handle to an SSL connection to be queried.
pCertBuff A pointer to the buffer in which the certificate should be written. The buffer size and address should be aligned to NSSL_IO_BUFFER_ALIGN.
pCertBuffLen An int pointer specifying the length of pCertBuff. NSSL_RVAL_INVALID_SIZE is returned if the certificate is larger than the provided buffer size. Use NSSLGetPeerCertSize to determine the size of the buffer to pass. After completion, length of the peer certificate (in DER form) is written into pCertBuffLen.

Return Values

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


Get SSL peer certificate in DER form.

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


Revision History

2012/08/16 Cleanup pass.
2012/04/06 Initial version.