Returns requested certificate information.
#include <ldap_ssl.h> int ldapssl_get_cert_attribute ( void *certHandle, unsigned long attrID, void *value, int *length);
(IN) Certificate handle received by a verify callback function.
(IN) Certificate information to return. See Table 6-3.
(OUT) Pointer to memory appropriate for the information requested.
(I/O) Pointer to length of value parameter memory.
This function is used to query information about a server certificate received by the verify callback routine.
The certHandle parameter is the certificate handle (void *) received by the verify callback routine.
The attrID parameter specifies the information to retrieve, and the value parameter points to memory appropriate for the information. For specific attrID(s) and data types see Table 6-3.
The length parameter is both an input and an output. On input, length is the size of the memory pointed to by the value parameter. On output, length is updated to reflect the actual size of the information copied.
In order to allocate memory, applications can pass in a NULL for the value parameter and the length parameter will be updated with the appropriate size, but no data will be copied. Applications can then allocate the appropriate memory and call ldapssl_get_cert_attribute again to retrieve the information.
For sample code, see sslbind_interactive.c.