#include <PKIFLDAPRepository.h>
The GetCertificates method will attempt to retrieve certificates from the following directory attributes:
caCertificate and caCertificate;binary userCertificate and userCertificate;binary crossCertificatePair and crossCertificatePair;binaryThe GetCRLs method will attempt to retrieve CRLs from the following directory attributes:
certificateRevocationList and certificateRevocationList;binary authorityRevocationList and authorityRevocationList;binary deltaRevocationList and deltaRevocationList;binaryCertificates greater than 20,000 bytes in size and CRLs greater than 100,000,000 bytes in size will not be retrieved. Referral handling is turned on by default and cannot be disabled. All directory operations performed by this class are synchronous.
TSP-enforcing: Yes
Definition at line 57 of file PKIFLDAPRepository.h.
Public Member Functions | |
CPKIFLDAPRepository (void) | |
virtual | ~CPKIFLDAPRepository (void) |
void | Initialize () |
void | GetCertificates (const CPKIFNamePtr &subDN, CPKIFCertificateList &certList, PKIInfoSource source=ALL) |
void | GetCertificates (const CPKIFCertificatePtr &cert, CPKIFCertificateList &certList, PKIInfoSource source=ALL, PathBuildingDirection pbd=PBD_FORWARD) |
void | GetCRLs (const CPKIFCertificatePtr &cert, CPKIFCRLList &crlList, PKIInfoSource source=ALL) |
int | GetPort () const |
void | Set_Port (int port) |
const char * | GetHost () const |
void | SetHost (const char *host) |
const char * | GetUsername () const |
void | SetUsername (const char *username) |
void | SetPassword (const char *password) |
void | SetSuppressConnectionErrors (bool b) |
bool | GetSuppressConnectionErrors () const |
void | GetCRLSources (const CPKIFCertificatePtr &cert, CPKIFCrlSourceList &crlNodeList, PKIInfoSource source=ALL) |
void | GetCertificateSources (const CPKIFCertificatePtr &cert, CPKIFCertificateSourceList &certs, PathBuildingDirection pbd=PBD_FORWARD) |
void | GetCRLs (const CPKIFNamePtr &entry, std::vector< std::string > &attributes, CPKIFCRLNodeList &crlList) |
void | GetCertificates (const CPKIFNamePtr &entry, std::vector< std::string > &attributes, CPKIFCertificateNodeList &certList, PathBuildingDirection pbd) |
void | AddNamespace (CPKIFGeneralSubtreePtr &name) |
CPKIFGeneralSubtreeList | GetNamespaces () |
PKIInfoSource | GetSourceType () |
CPKIFLDAPRepository::CPKIFLDAPRepository | ( | void | ) |
Interface: External
This function creates and initializes CPKIFLDAPRepository objects. The following properties are initialized to the specified default values:
· Port: 389 · SuppressConnectionErrors: falseFollowing creation of a CPKIFLDAPRepository, it is necessary to specify the host name and port, if other than the default value, prior to adding the object to the collection of colleagues managed by an instance of CPKIFCacheMediator2.
Definition at line 155 of file CACLDAPRepository.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SR_LDAPREPOSITORY.
CPKIFLDAPRepository::~CPKIFLDAPRepository | ( | void | ) | [virtual] |
Interface: External
This function destroys CPKIFLDAPRepository objects.
Definition at line 178 of file CACLDAPRepository.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SR_LDAPREPOSITORY.
void CPKIFLDAPRepository::Initialize | ( | void | ) | [virtual] |
Interface: External
This function initializes an instance for use in a collection of IPKIFColleague objects held by a mediator
Reimplemented from IPKIFColleague.
Definition at line 200 of file CACLDAPRepository.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_SR_LDAPREPOSITORY.
void CPKIFLDAPRepository::GetCertificates | ( | const CPKIFNamePtr & | subDN, | |
CPKIFCertificateList & | certList, | |||
PKIInfoSource | source = ALL | |||
) | [virtual] |
Interface: External
This function appends pointers to certificates found in the directory entry identified by the subDN parameter to certList. This function does not ensure that all certificates are issued to the name identified in the subDN parameter. If the directory entry contains extraneous certificates those certificates will be returned. Any non-certificate material found in a certificate attribute will be discarded without raising an exception. This function searches the caCertificate;binary and crossCertificatePair;binary attributes with a search filter of "objectclass=*". The function simply returns without searching when source is equal to LOCAL. This function may generate an exception containing the following error codes CACHE_LDAP_ERROR, and CACHE_PARSE_ERROR.
CPKIFCacheException(CACHE_LDAP_CONNECT_AND_BIND_FAILED) | ||
CPKIFCacheException(CACHE_LDAP_ERROR) |
subDN | [in] Pointer to a distinguished name corresponding to the subject distinguished name in the desired certificates |
certList | [out] List of pointers to certificates with a subject distinguished name equal to the value passed via the subDN parameter |
source | [in] PKIInfoSource value indicating the types of locations that should be searched for certificates |
Implements IPKIFCertRepository.
Definition at line 514 of file CACLDAPRepository.cpp.
References PKIFENUMS::PBD_FORWARD.
void CPKIFLDAPRepository::GetCertificates | ( | const CPKIFCertificatePtr & | cert, | |
CPKIFCertificateList & | certList, | |||
PKIInfoSource | source = ALL , |
|||
PathBuildingDirection | pbd = PBD_FORWARD | |||
) | [virtual] |
Interface: External
This function retrives certificate from LDAP
Reimplemented from IPKIFCertRepository.
Definition at line 859 of file CACLDAPRepository.cpp.
References PKIFENUMS::PBD_FORWARD.
void CPKIFLDAPRepository::GetCRLs | ( | const CPKIFCertificatePtr & | cert, | |
CPKIFCRLList & | crlList, | |||
PKIInfoSource | source = ALL | |||
) | [virtual] |
Interface: External
This function appends pointers to CRLs found that may be applicable to cert to crlList. This function does not ensure that all CRLs are applicable. If the directory entry contains extraneous CRLs those CRLs will be returned. Any non-CRL material found in a CRL attribute will be discarded without raising an exception. This function searches the certificateRevocationList;binary and authorityRevocationList;binary attributes with a search filter of "objectclass=*". The function simply returns without searching when source is equal to LOCAL. This function will search directory entries identified in CRL DP extensions, if present. This function may generate an exception containing the following error codes CACHE_LDAP_ERROR, and CACHE_PARSE_ERROR.
CPKIFCacheException(-1) | ||
CPKIFCacheException(CACHE_LDAP_CONNECT_AND_BIND_FAILED) | ||
CPKIFCacheException(CACHE_LDAP_ERROR) |
cert | [in] Pointer to a certificate for which revocation status is to be checked |
crlList | [out] Reference to a CRL list to receive CRLs that may be associated with the specified certificate |
source | [in] PKIInfoSource indicating the locations to search for CRLs |
Implements IPKIFCRLRepository.
Definition at line 905 of file CACLDAPRepository.cpp.
References CACHE_LDAP_CONNECT_AND_BIND_FAILED, CACHE_PARSE_ERROR, CLEANUP, CollectNamesFromCRLDP(), IsNonDirName(), PKIFENUMS::LOCAL, LOG_STRING_DEBUG, LOG_STRING_ERROR, LOG_STRING_INFO, RAISE_CACHE_EXCEPTION, GottaMatch< T >::SetRHS(), stricmp, and TOOLKIT_SR_LDAPREPOSITORY.
int CPKIFLDAPRepository::GetPort | ( | ) | const |
Interface: External
This function returns an integer containing the value of the Port property. By default, the Port property is set to 389. The value can be set to a different value by invoking the Set_Port method
CPKIFCacheException(COMMON_INVALID_INPUT) |
Definition at line 216 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::Set_Port | ( | int | port | ) |
Interface: External
This function is used to specify the port used to access the target LDAP-accessible directory. By default, the port value is set to 389. This function should be called prior to using the object, i.e. prior to associating the object with a mediator/colleague collection. Once opened, LDAP connections remain open for the lifetime of an instance of CPKIFLDAPRepository. Specifying the port on an object that has an open connection will not take effect unless the connection is broken and reestablished.
Specification of a port value greater than 65535 will result in a CPKIFCacheException indicating COMMON_INVALID_INPUT.
CPKIFCacheException(COMMON_INVALID_INPUT) |
port | [in] Integer containing the new value for the port property |
Definition at line 237 of file CACLDAPRepository.cpp.
References COMMON_INVALID_INPUT, and RAISE_CACHE_EXCEPTION.
const char * CPKIFLDAPRepository::GetHost | ( | ) | const |
Interface: External
This function is used to retrieve the name of the target LDAP-accessible directory host (DNS name or IP address).
None
Definition at line 259 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::SetHost | ( | const char * | host | ) |
Interface: External
This function is used to specify the hostname of an LDAP-accessible directory server. The name should be expressed as an IP address or DNS name. Specification of an unreachable host will not manifest itself as an error until an attempt is made to contact the server. Once opened, LDAP connections remain open for the lifetime of an instance of CPKIFLDAPRepository. Specifying the host for an object that has an open connection will not take effect unless the connection is broken and reestablished.
Passing NULL as the host parameter will result in a CPKIFCacheException indicating COMMON_INVALID_INPUT.
CPKIFCacheException(COMMON_INVALID_INPUT) |
host | [in] Pointer to a NULL-terminated array of characters containing the name of the target LDAP-accessible directory |
Definition at line 279 of file CACLDAPRepository.cpp.
References COMMON_INVALID_INPUT, and RAISE_CACHE_EXCEPTION.
const char * CPKIFLDAPRepository::GetUsername | ( | ) | const |
Interface: External
The function GetUsername is used to retrieve the username used to bind to the target LDAP-accessible directory. Typically, anonymous bind operations are performed and GetUsername is not called.
None
Definition at line 303 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::SetUsername | ( | const char * | username | ) |
Interface: External
The function SetUsername is used to specify the usernameused to bind to the target LDAP-accessible directory. Typically, anonymous bind operations are performed and SetUsername is not called.
username | [in] Pointer to a NULL terminated array of characters containing the username to use during subsequent bind operations |
Definition at line 316 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::SetPassword | ( | const char * | password | ) |
Interface: External
This function is used to specify the password used to bind to the target LDAP-accessible directory. Typically, anonymous bind operations are performed and this function need not be called.
password | [in] Pointer to a NULL terminated array of characters containing the password to use during subsequent bind operations |
Definition at line 331 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::SetSuppressConnectionErrors | ( | bool | b | ) |
Interface: External
This function is used to turn on/off suppression of connection-related errors. By default, connection-related errors are not suppressed, i.e. an exception is raised when either a connection or bind failure occurs. When connection-related errors are suppressed, no exception is thrown and the object silently fails without searching for the requested information.
b | [in] Boolean value used to set the SuppressConnectionErrors property |
Definition at line 348 of file CACLDAPRepository.cpp.
bool CPKIFLDAPRepository::GetSuppressConnectionErrors | ( | ) | const |
Interface: External
This function is used to retrive error suppression indicator. By default, connection-related errors are not suppressed, i.e. an exception is raised when either a connection or bind failure occurs. When connection-related errors are suppressed, no exception is thrown and the object silently fails without searching for the requested information.
Definition at line 365 of file CACLDAPRepository.cpp.
void CPKIFLDAPRepository::GetCRLSources | ( | const CPKIFCertificatePtr & | cert, | |
CPKIFCrlSourceList & | crlList, | |||
PKIInfoSource | source = ALL | |||
) |
Interface: External
This function retrives CRL sources
cert | [in] Pointer to a certificate for which revocation status is to be checked |
crlList | [out] Reference to a CRL list to receive CRLs that may be associated with the specified certificate |
source | [in] Enum indicating type of source being sought (i.e., local or remote) |
Definition at line 1279 of file CACLDAPRepository.cpp.
References CollectNamesFromCRLDP(), CPKIFCacheMediator2::GetColleagues(), GetLdapUriMultiAttr(), IsNonDirName(), PKIFENUMS::LOCAL, LOG_STRING_DEBUG, IPKIFColleague::m_parents, GottaMatch< T >::SetRHS(), TOOLKIT_SR_LDAPREPOSITORY, and UriAlreadyInList().
void CPKIFLDAPRepository::GetCertificateSources | ( | const CPKIFCertificatePtr & | cert, | |
CPKIFCertificateSourceList & | certs, | |||
PathBuildingDirection | pbd = PBD_FORWARD | |||
) |
Interface: External
This function retrives certificate sources
cert | [in] A reference to a smart pointer to CPKIFCertificate object |
certs | [out] A reference to CPKIFCertificateSourceList object |
pbd | [in] enum indicating build direction |
Definition at line 1964 of file CACLDAPRepository.cpp.
References CPKIFCacheMediator2::GetColleagues(), GetLdapUriMultiAttr(), IPKIFColleague::m_parents, PKIFENUMS::PBD_FORWARD, and UriAlreadyInList().
void CPKIFLDAPRepository::GetCRLs | ( | const CPKIFNamePtr & | issDN, | |
std::vector< std::string > & | attributes, | |||
CPKIFCRLNodeList & | crlList | |||
) |
Interface: External
This function retrives CRLs from LDAP repository
Definition at line 1758 of file CACLDAPRepository.cpp.
References CACHE_LDAP_CONNECT_AND_BIND_FAILED, CACHE_PARSE_ERROR, CLEANUP, GetLdapUriMultiAttr(), LOG_STRING_DEBUG, LOG_STRING_ERROR, LOG_STRING_INFO, RAISE_CACHE_EXCEPTION, GottaMatch< T >::SetRHS(), and TOOLKIT_SR_LDAPREPOSITORY.
void CPKIFLDAPRepository::GetCertificates | ( | const CPKIFNamePtr & | issDN, | |
std::vector< std::string > & | attributes, | |||
CPKIFCertificateNodeList & | certNodeList, | |||
PathBuildingDirection | pbd | |||
) |
Interface: External
This function retrives Certificates from LDAP repository
Definition at line 1422 of file CACLDAPRepository.cpp.
References CACASNWRAPPER_CREATE, CACHE_LDAP_CONNECT_AND_BIND_FAILED, CACHE_PARSE_ERROR, CLEANUP, COMMON_INVALID_INPUT, GetLdapUriMultiAttr(), LOG_STRING_DEBUG, LOG_STRING_ERROR, LOG_STRING_INFO, PAS_AVAILABLE, PKIFENUMS::PBD_FORWARD, PKIFENUMS::PBD_REVERSE, RAISE_CACHE_EXCEPTION, PKIFENUMS::REMOTE, GottaMatch< T >::SetRHS(), CaseInsensitiveFind::SetRHS(), stricmp, TOOLKIT_CACHE, and TOOLKIT_SR_LDAPREPOSITORY.
void CPKIFLDAPRepository::AddNamespace | ( | CPKIFGeneralSubtreePtr & | name | ) |
Interface: External
This function add a namespace to the namespace list
Definition at line 2030 of file CACLDAPRepository.cpp.
CPKIFGeneralSubtreeList CPKIFLDAPRepository::GetNamespaces | ( | ) |
Interface: External
This function returns the list of acceptable namespaces
Definition at line 2041 of file CACLDAPRepository.cpp.
PKIInfoSource CPKIFLDAPRepository::GetSourceType | ( | ) | [inline, virtual] |
Implements IPKIFCertRepository.
Definition at line 98 of file PKIFLDAPRepository.h.
References PKIFENUMS::REMOTE.