ldapssl_get_cert_attribute

Returns requested certificate information.

LDAP Version:v3
Library:*ldapssl.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap_ssl.h>
  
  int ldapssl_get_cert_attribute (
     void           *certHandle,
     unsigned long   attrID,
     void           *value,
     int            *length);
  
  

Parameters

certHandle

(IN) Certificate handle received by a verify callback function.

attrID

(IN) Certificate information to return. See Table 6-3.

value

(OUT) Pointer to memory appropriate for the information requested.

length

(I/O) Pointer to length of value parameter memory.

Return Values

0

Success

-1

Failure

Remarks

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.

See Also

ldapssl_set_verify_callback