Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldapssl_advclientauth_init()

Initializes your client application to connect to a secure LDAP server over SSL and to use certificate-based client authentication.

Syntax

#include <ldap_ssl.h>
int LDAP_CALL ldapssl_advclientauth_init( char *certdbpath,
   void *certdbhandle, int needkeydb, char *keydbpath,
   void *keydbhandle, int needsecmoddb, char *secmodpath,
   const int sslstrength);

Parameters

This function has the following parameters:

certdbpath

Path to the database containing certificates for your client. The database must be the cert7.db certificate database used by Netscape Communicator 4.x.

Note the following:

certdbhandle

Pass a NULL value for this. (This parameter is not used currently.)

needkeydb

Specifies whether or not the private key database needs to be opened for use. This parameter can have one of the following values:

keydbpath

Path to the database containing the private key certified by your certificate. The database must be the key3.db private key database used by Netscape Communicator 4.x.

Note the following:

certdbhandle

Pass a NULL value for this. (This parameter is not used currently.)

needsecmoddb

Specifies whether or not the security module database file needs to be opened for use. This parameter can have one of the following values:

secmodpath

Path to the database containing security modules. The database must be the secmod.db private key database used by Netscape Communicator 4.x.

Note the following:

sslstrength

Specifies how the server certificate is evaluated. You can specify one of the following values:

Returns

One of the following values:

Description

You can call the ldapssl_advclientauth_init() function to initialize your client application for SSL and for certificate-based client authentication.

This function is similar to ldapssl_clientauth_init() and allows you to do the following:

You must call this function before calling the ldapssl_init() function to connect to the server. For details, see Chapter 12, "Connecting Over SSL".

Example

The following example initializes a client before connecting with a secure LDAP server.

#include <ldap.h>
#include <ldap_ssl.h>
#include <stdio.h>
...
/* Initialize client, using mozilla's certificate database */
if ( ldapssl_advclientauth_init( "/u/mozilla/.netscape/cert7.db", 
   NULL, 1, "/u/mozilla/.netscape/key3.db", NULL , 1, 
   "/u/mozilla/.netscape/secmod.db", LDAPSSL_AUTH_CNCHECK) < 0 ) {
   perror( "ldap_advclientauth_init" );
      return( 1 );
   }
} 
...

See Also

ldap_init(), ldapssl_clientauth_init(), ldapssl_init(), ldapssl_install_routines().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23