CACLDAPRepository.cpp File Reference


Detailed Description

Subsystem: Certificate and CRL Storage and Retrieval (PKIFSR)

Module: CPKIFLDAPRepository

Id
CACLDAPRepository.cpp 11143 2010-01-20 21:52:13Z cwallace

Definition in file CACLDAPRepository.cpp.

#include "PKIFLDAPRepository.h"
#include "ToolkitUtils.h"
#include "Name.h"
#include "GeneralName.h"
#include "Certificate.h"
#include "GottaMatch.h"
#include "CRL.h"
#include "PKIFCRLNodeEntry.h"
#include "PKIFLdapCertNode.h"
#include "PKIFLdapCrlNode.h"
#include "PKIFCacheMediator2.h"
#include "GeneralSubtree.h"
#include "PKIFCacheErrors.h"
#include "PKIFCacheException.h"
#include "CSingletonLDAPConnection.h"
#include "ASN1Helper.h"
#include "PKIX1Implicit88.h"
#include "PKIX1Explicit88.h"
#include "boost/numeric/conversion/cast.hpp"
#include "boost/numeric/conversion/bounds.hpp"
#include "boost/limits.hpp"
#include "curl/curl.h"
#include "ldap.h"
#include <sys/unistd.h>
#include <sstream>
#include <strstream>

Include dependency graph for CACLDAPRepository.cpp:

Go to the source code of this file.

Classes

class  CaseInsensitiveFind

Defines

#define CLEANUP
#define CLEANUP
#define CLEANUP
#define CLEANUP
#define CLEANUP

Functions

a a CAC_API CPKIFLDAPRepositoryPtr MakeLDAPRepository ()
CAC_API void FreeLDAPRepository (CPKIFLDAPRepository *ldap)
bool IsNonDirName (const CPKIFGeneralNamePtr &gn)
std::string GetLdapUriMultiAttr (const char *host, int port, const char *entryDn, vector< string > &attributeList)
std::string GetLdapUri (const char *host, int port, const char *entryDn, const char *attribute)

Variables

CAC_API char g_defCACCAPIStore [] = "CA"
CAC_API char g_defCACCAPIEEStore [] = "AddressBook"


Define Documentation

#define CLEANUP

Value:

{ \
    if(NULL != binaryValuesPtr)\
    { ldap_value_free_len(binaryValuesPtr);binaryValuesPtr = NULL;}\
    if(NULL != tempAttrName)\
    { ldap_memfree(tempAttrName);tempAttrName = NULL;}\
    if(NULL != ber_temp)\
    { ber_free(ber_temp, 0);ber_temp = NULL;}\
    if(NULL != results)\
    { ldap_msgfree(results); results = NULL;}\
}

#define CLEANUP

Value:

{ \
    if(NULL != binaryValuesPtr)\
    { ldap_value_free_len(binaryValuesPtr);binaryValuesPtr = NULL;}\
    if(NULL != tempAttrName)\
    { ldap_memfree(tempAttrName);tempAttrName = NULL;}\
    if(NULL != ber_temp)\
    { ber_free(ber_temp, 0);ber_temp = NULL;}\
    if(NULL != results)\
    { ldap_msgfree(results); results = NULL;}\
    if(attrsOfInterest) {delete attrsOfInterest; attrsOfInterest = NULL;}\
}

#define CLEANUP

Value:

{ \
    if(NULL != binaryValuesPtr)\
    { ldap_value_free_len(binaryValuesPtr);binaryValuesPtr = NULL;}\
    if(NULL != tempAttrName)\
    { ldap_memfree(tempAttrName);tempAttrName = NULL;}\
    if(NULL != ber_temp)\
    { ber_free(ber_temp, 0);ber_temp = NULL;}\
    if(NULL != results)\
    { ldap_msgfree(results); results = NULL;}\
}

#define CLEANUP

Value:

{ \
    if(NULL != binaryValuesPtr)\
    { ldap_value_free_len(binaryValuesPtr);binaryValuesPtr = NULL;}\
    if(NULL != tempAttrName)\
    { ldap_memfree(tempAttrName);tempAttrName = NULL;}\
    if(NULL != ber_temp)\
    { ber_free(ber_temp, 0);ber_temp = NULL;}\
    if(NULL != results)\
    { ldap_msgfree(results); results = NULL;}\
}

#define CLEANUP

Value:

{ \
    if(NULL != binaryValuesPtr)\
    { ldap_value_free_len(binaryValuesPtr);binaryValuesPtr = NULL;}\
    if(NULL != tempAttrName)\
    { ldap_memfree(tempAttrName);tempAttrName = NULL;}\
    if(NULL != ber_temp)\
    { ber_free(ber_temp, 0);ber_temp = NULL;}\
    if(NULL != results)\
    { ldap_msgfree(results);results = NULL;}\
}


Function Documentation

CAC_API void FreeLDAPRepository ( CPKIFLDAPRepository ldap  ) 

Interface: External

This function is used to delete CPKIFLDAPRepository objects allocated using the MakeLDAPRepository function.

Returns:
None
Parameters:
ldap  [in] Pointer to the CPKIFLDAPRepository object to delete

Definition at line 131 of file CACLDAPRepository.cpp.

std::string GetLdapUri ( const char *  host,
int  port,
const char *  entryDn,
const char *  attribute 
)

Interface: External

GetLdapUri takes a hostname, port number, string representation of the entry DN and a single attribute. Thus, the URIs returned by this function can only address a single attribute. The format is as defined in RFC 1959:

<ldapurl> ::= "ldap://" [ <hostport> ] "/" <dn> [ "?" <attributes> [ "?" <scope> "?" <filter> ] ]

<hostport> ::= <hostname> [ ":" <portnumber> ]

<dn> ::= a string as defined in RFC 1485

<attributes> ::= NULL | <attributelist>

<attributelist> ::= <attributetype> | <attributetype> [ "," <attributelist> ]

<attributetype> ::= a string as defined in RFC 1777

<scope> ::= "base" | "one" | "sub"

<filter> ::= a string as defined in RFC 1558

Returns:
None
Parameters:
host  [in] string indicating host
port  [in] string indicating port
entryDn  [in] string indicating entryDn
attribute  [in] string indicating attribute

Definition at line 1235 of file CACLDAPRepository.cpp.

References COMMON_INVALID_INPUT, and TOOLKIT_CACHE.

std::string GetLdapUriMultiAttr ( const char *  host,
int  port,
const char *  entryDn,
vector< string > &  attributeList 
)

Interface: External

GetLdapUri takes a hostname, port number, string representation of the entry DN and a single attribute. Thus, the URIs returned by this function can only address a single attribute. The format is as defined in RFC 1959:

<ldapurl> ::= "ldap://" [ <hostport> ] "/" <dn> [ "?" <attributes> [ "?" <scope> "?" <filter> ] ]

<hostport> ::= <hostname> [ ":" <portnumber> ]

<dn> ::= a string as defined in RFC 1485

<attributes> ::= NULL | <attributelist>

<attributelist> ::= <attributetype> | <attributetype> [ "," <attributelist> ]

<attributetype> ::= a string as defined in RFC 1777

<scope> ::= "base" | "one" | "sub"

<filter> ::= a string as defined in RFC 1558

Returns:
None
Parameters:
host  [in] string indicating host
port  [in] string indicating port
entryDn  [in] string indicating entryDn
attributeList  [in] vector of strings indicating attributes

Definition at line 1162 of file CACLDAPRepository.cpp.

References COMMON_INVALID_INPUT, and TOOLKIT_CACHE.

Referenced by CPKIFLDAPRepository::GetCertificates(), CPKIFLDAPRepository::GetCertificateSources(), CPKIFLDAPRepository::GetCRLs(), and CPKIFLDAPRepository::GetCRLSources().

bool IsNonDirName ( const CPKIFGeneralNamePtr &  gn  ) 

Interface: Subsystem

This function returns true only if gn is a general name of type other than directory name.

Returns:
True only if gn is a general name of type other than directory name, false otherwise.
Parameters:
gn  [in] Reference to a smart pointer to a CPKIFGeneralName object to examine.

Definition at line 880 of file CACLDAPRepository.cpp.

References CPKIFGeneralName::DIRECTORYNAME.

Referenced by CPKIFLDAPRepository::GetCRLs(), and CPKIFLDAPRepository::GetCRLSources().

a a CAC_API CPKIFLDAPRepositoryPtr MakeLDAPRepository (  ) 

Interface: External

This function wraps the CPKIFLDAPRepository constructor, returning a pointer to the new object.

Returns:
Pointer to CPKIFLDAPRepository object

Definition at line 119 of file CACLDAPRepository.cpp.


Variable Documentation

CAC_API char g_defCACCAPIEEStore[] = "AddressBook"

Definition at line 57 of file CACLDAPRepository.cpp.

CAC_API char g_defCACCAPIStore[] = "CA"

Definition at line 56 of file CACLDAPRepository.cpp.

Referenced by MakeDefaultMediator(), and SaveStorageAndRetrievalComponents().


Generated on Mon Nov 15 11:16:14 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6