ldapssl_add_trusted_cert

Adds certificates to the list of trusted certificates.

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_add_trusted_cert (
     void   *cert,
     int     type);
  
  

Parameters

cert

(IN) Points to the trusted root certificate to add.

type

(IN) Certificate type. This must be one of the following values:

  • LDAPSSL_CERT_FILETYPE_B64

  • LDAPSSL_CERT_FILETYPE_DER

  • LDAPSSL_CERT_BUFFTYPE_B64

  • LDAPSSL_CERT_BUFFTYPE_DER

Return Values

0

Success

-1

Failure

Remarks

This function can be called repeatedly to build a group of trusted certificates. It supports certificates encoded as DER and B64 (PEM) formats.

When one of the "FILETYPE" types is specified (see the type parameter), the cert parameter must be a pointer to a character array containing the fully qualified filename of the file containing the certificate. When one of the "BUFFTYPE" types are specified, the cert parameter must be a pointer an LDAPSSL_Cert structure.

For sample code, see sslbind.c, sslbind_interactive.c.

See Also

ldapssl_client_init, ldapssl_client_deinit, ldapssl_init, ldapssl_install_routines