RSA Security logo

RSA BSAFE Cert-C
API Reference

ldapapi.h

Go to the documentation of this file.
00001 /*
00002 ** Copyright (c) 1999-2002, RSA Security Inc.
00003 **
00004 ** This file is used to demonstrate how to interface to an RSA
00005 ** Security licensed development product.  You have a
00006 ** royalty-free right to use, modify, reproduce and distribute this
00007 ** demonstration file (including any modified version), provided that
00008 ** you agree that RSA Security has no warranty, implied or
00009 ** otherwise, or liability for this demonstration file or any modified
00010 ** version.
00011 **
00012 */
00013 
00014 
00015 #ifndef _LDAPAPI_H_
00016 #define _LDAPAPI_H_ 1
00017 
00024 #include "certc.h"
00025 #include "transprt.h"
00026 
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 
00033 /* Max lengths must be within internal database limitations */
00034 #define MAXLEN_LD_NAME                (63)
00035 #define MAXLEN_LD_NETADDR             (63)
00036 #define MAXLEN_LD_DN                 (255)
00037 #define MAXLEN_LD_PASSPHRASE          (63)
00038 #define MAXLEN_LD_STR                (255)
00039 #define MAXLEN_LD_CFG_DBNAME         (255)
00040 
00041 #define DEFAULT_LDAP_CFG_NAME   "ldcfdflt" /* default if not supplied */
00042 
00043 
00166 typedef struct LDAP_DATA
00167 {
00168   char         descriptiveName[MAXLEN_LD_NAME];
00169   char         networkAddress[MAXLEN_LD_NETADDR];
00170   unsigned int portNo;
00171   unsigned int authType;
00172   unsigned int sizeLimit;
00173   unsigned int timeLimit;
00174   char         baseDNAttrs[MAXLEN_LD_STR];
00175   char         searchRoot[MAXLEN_LD_STR];
00176   char         searchFilterAttrs[MAXLEN_LD_STR];
00177   char         certificateAttrs[MAXLEN_LD_STR];
00178   char         certificateRevocationAttrs[MAXLEN_LD_STR];
00179   unsigned int searchPriority;
00180   unsigned int disconnectBeforeConnect;
00181   ITEM         otherData;
00182 } LDAP_DATA, *PLDAP_DATA;
00183 
00218 typedef struct {
00219   char cfgDbName[MAXLEN_LD_CFG_DBNAME];    /* data store name */
00220   char sourceName[MAXLEN_LD_NAME];         /* name of source being initialized */
00221   char userName[MAXLEN_LD_DN];             /* user name - DN for LDAP authentication (optional) */
00222   char userPassword[MAXLEN_LD_PASSPHRASE]; /* password - for LDAP authentication (optional) */
00223 } LDAP_INIT_PARAMS, * PLDAP_INIT_PARAMS;
00224 
00225 
00257 typedef struct LDAP_OPTIONS_INFO
00258 {
00259   unsigned int      authType;
00260   unsigned int      sizeLimit;
00261   unsigned int      timeLimit;
00262   char              baseDNAttrs[MAXLEN_LD_STR];
00263   char              searchFilterAttrs[MAXLEN_LD_STR];
00264   char              certificateAttrs[MAXLEN_LD_STR];
00265   char              certificateRevocationAttrs[MAXLEN_LD_STR];
00266   unsigned int      disconnectBeforeConnect;
00267   char              userName[MAXLEN_LD_DN];
00268   char              userPassword[MAXLEN_LD_PASSPHRASE];
00269 } LDAP_OPTIONS_INFO, *PLDAP_OPTIONS_INFO;
00270 
00290 typedef struct LDAP_DATA2
00291 {
00292   TRANSPORT_INFO            ldapTransportInfo;
00293   LDAP_OPTIONS_INFO         ldapOptionsInfo;
00294 } LDAP_DATA2, *PLDAP_DATA2;
00295 
00365 int S_InitializeLDAPSource (
00366   POINTER        ctx,       /* in - CertC context */
00367   POINTER        params,    /* in - pointer to LDAP_INIT_PARAMS */
00368   SERVICE_FUNCS *funcs,     /* out - fxn pointers for LDAP provider */
00369   POINTER       *handle);   /* out - handle to this instance of the provider */
00370 
00435 int S_InitializeLDAP2 (
00436   POINTER        ctx,       /* in - CertC context */
00437   POINTER        params,    /* in - pointer to LDAP_INIT_PARAMS */
00438   SERVICE_FUNCS *funcs,     /* out - fxn pointers for LDAP provider */
00439   POINTER       *handle);   /* out - handle to this instance of the provider */
00440 
00478 int S_InsertLDAPConfigRecord(
00479   CERTC_CTX   ctx,          /* in - CertC context */
00480   char       *dbName,       /* in - data store name */
00481   PLDAP_DATA  pLdapData     /* in - config record to insert */
00482   );
00483 
00515 int S_SelectLDAPConfigRecord(
00516   CERTC_CTX   ctx,          /* in - CertC context */
00517   char       *dbName,       /* in - data store name */
00518   PLDAP_DATA  pLdapData);   /* mod - ldap config data record, if found.
00519                                Storage must exist and the descriptiveName must
00520                                be filled in with name of record to select */
00521 
00544 int S_DeleteLDAPConfigRecord(
00545   CERTC_CTX  ctx,           /* in - CertC context */
00546   char      *dbName,        /* in - data store name */
00547   char      *sourceName);   /* in - name of source to delete */
00548 
00575 int S_GetLDAPSourceList(
00576   CERTC_CTX  ctx,              /*in - CertC context */
00577   char      *dbName,           /*in - data store name */
00578   LIST_OBJ  *ldapSourceNames); /*out - name list of all configured sources */
00579 
00580 #ifdef __cplusplus
00581 }
00582 #endif
00583 
00584 #endif /* _LDAPAPI_H_ */



RSA BSAFE® Cert-C 2.7 API Reference