#include <PKIFPathValidator2.h>
The purpose of this class is to provide an implementation of the certification path validation algorithm expressed in X.509 (and restated in RFC3280). This class breaks certification path processing into the following three stages:
Basic path validation checks (e.g. name chaining, policy processing, name constraints, etc.)
Signature verification beginning with the trust anchor and proceeding through the target certificate
Revocation status determination, which will be performed using the functionality available via the associated mediator objects
The ValidatePath function provides the implementation and takes a complete certification path as input. Result information is returned via an instance of CPKIFPathValidationResults. State information is updated on the path object to support iterative invocation of path development and path validation functionality.
TSP-enforcing: No
Definition at line 43 of file PKIFPathValidator2.h.
Public Member Functions | |
CPKIFPathValidator2 () | |
virtual | ~CPKIFPathValidator2 (void) |
void | Initialize () |
bool | ValidatePath (CPKIFCertificatePath &path, CPKIFPathValidationResults &results, CPKIFFuncStoragePtr &thisCallOnlyFuncs) |
void | SetAdditionalCertificateChecks (CPKIFFuncStoragePtr &funcs) |
bool | GetEnforceTrustAnchorConstraints () const |
void | SetEnforceTrustAnchorConstraints (bool b) |
CPKIFPathValidator2::CPKIFPathValidator2 | ( | ) |
Interface: External
This function creates and initializes CPKIFPathValidator2 objects.
Definition at line 58 of file PKIFPathValidator2.cpp.
CPKIFPathValidator2::~CPKIFPathValidator2 | ( | void | ) | [virtual] |
Interface: External
This function destroys CPKIFPathValidator2 objects.
Definition at line 95 of file PKIFPathValidator2.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_PATH_VALIDATOR.
void CPKIFPathValidator2::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 111 of file PKIFPathValidator2.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_PATH_VALIDATOR.
bool CPKIFPathValidator2::ValidatePath | ( | CPKIFCertificatePath & | path, | |
CPKIFPathValidationResults & | results, | |||
CPKIFFuncStoragePtr & | thisCallOnlyFuncs | |||
) | [virtual] |
Interface: External
This function will validate the path passed via the path parameter and return status information via the results parameter. Basic path validation checks will be performed (per X.509), certificate signatures will be validated and revocation status will be determined, if possible. This function may generate an exception containing the following error code PATH_TRUST_ROOT_NO_CERT.
When trust anchor constraint enforcement is enabled, the following constraints are read from the trust anchor and used to prepare the path validation inputs:
CPKIFPathException(PATH_TRUST_ROOT_NO_CERT) | ||
CPKIFPathException(COMMON_MEDIATOR_MISSING) | ||
CPKIFPathException(COMMON_INVALID_INPUT) |
path | [in] Reference to a CPKIFCertificatePath object containing the certification path to validate |
results | [out] Reference to a CPKIFPathValidationResults object containing the results of a validation operation |
thisCallOnlyFuncs | [out] Pointer to a CPKIFFuncStorage containing the application-defined checks to invoke during path validation |
Implements IPKIFPathValidate.
Definition at line 146 of file PKIFPathValidator2.cpp.
References IPKIFRevocationStatus::CheckStatusPath(), COMMON_INVALID_INPUT, COMMON_MEDIATOR_MISSING, CPKIFPathBasicChecks2::DoChecks(), FindErrorAndSetOnResults(), g_anyPolicy, CPKIFX509ExtensionMediator2::GetInstance(), CPKIFCertificatePath::GetPath(), CPKIFCertificatePath::GetPathSettings(), CPKIFCertificatePath::GetTarget(), CPKIFCertificatePath::GetTrustRoot(), IntersectSets(), IntersectSubtrees(), LOG_STRING_DEBUG, NOT_REVOKED, PATH_LENGTH_VIOLATION, PATH_UNPROCESSED_CRITICAL_EXTENSION, PathSigChecker(), CPKIFPathValidationResults::SetCertificate(), CPKIFPathValidationResults::SetCertStatus(), CPKIFPathValidationResults::SetRevocationStatusMostSevere(), CPKIFPathValidationResults::SetTargetIsTrustAnchor(), CPKIFPathValidationResults::SetTrustAnchor(), and TOOLKIT_PATH_VALIDATOR.
void CPKIFPathValidator2::SetAdditionalCertificateChecks | ( | CPKIFFuncStoragePtr & | funcs | ) | [virtual] |
Interface: External
This function is used to set up a functor to perform additional validation during a call to ValidatePath. For each certificate in the path, ValidatePath will invoke the functor object set via a call to this function. Functor can cause path validation to fail. Checks typically performed by functors include checking key usage or extended key usage extensions or checking private extensions.
funcs | [in] Pointer to a CPKIFFuncStoragePtr containing the application-defined checks to invoke during path validation |
Implements IPKIFPathValidate.
Definition at line 76 of file PKIFPathValidator2.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_PATH_VALIDATOR.
bool CPKIFPathValidator2::GetEnforceTrustAnchorConstraints | ( | ) | const |
GetEnforceTrustAnchorConstraints returns a boolean value indicating whether or not trust anchor constraints are enforced as part of path validation. By default, trust anchor constraints are not enforced.
Definition at line 542 of file PKIFPathValidator2.cpp.
void CPKIFPathValidator2::SetEnforceTrustAnchorConstraints | ( | bool | b | ) |
SetEnforceTrustAnchorConstraints is used to specify a boolean value indicating whether or not trust anchor constraints are enforced as part of path validation. By default, trust anchor constraints are not enforced. This function can be used to subsequently enable or disable trust anchor constraint enforcement.
Definition at line 553 of file PKIFPathValidator2.cpp.