CPKIFException Class Reference

#include <PKIFException.h>

Inheritance diagram for CPKIFException:

Inheritance graph
[legend]
Collaboration diagram for CPKIFException:

Collaboration graph
[legend]

List of all members.


Detailed Description

CPKIFException is the base class for all PKIF exception objects. It provides an implementation of the methods to extract information from an exception object.

TSP-enforcing: Yes

Definition at line 33 of file PKIFException.h.


Public Member Functions

 CPKIFException (const CPKIFException &e)
 CPKIFException (int subComponentID, int errorCode)
 CPKIFException (int subComponentID, int errorCode, char *fileName, int lineNumber)
 CPKIFException (int subComponentID, int errorCode, const char *errorDescription)
 CPKIFException (int subComponentID, int errorCode, const char *errorDescription, char *fileName, int lineNumber)
virtual ~CPKIFException (void) STDLIB_SUPER_THROW
void push_info (CPKIFException &e2)
void GetExceptionInfos (std::vector< ExceptionInfoPtr > &v)
int GetErrorCode () const
int GetSubcomponentID () const
const char * GetDescription () const
CPKIFStringPtr print () const

Constructor & Destructor Documentation

CPKIFException::CPKIFException ( const CPKIFException e  ) 

Interface: External

These five constructors provide means of creating exception objects containing various combinations of exception-related information

Returns:
None
Parameters:
e  [in] Reference to a CPKIFException object to copy

Definition at line 180 of file CACException.cpp.

References m_impl.

Referenced by CPKIFException().

CPKIFException::CPKIFException ( int  subComponent,
int  errorCode 
)

Interface: External

These five constructors provide means of creating exception objects containing various combinations of exception-related information

Returns:
None
Parameters:
subComponent  [in] Integer identifying the subcomponent that generated the exception
errorCode  [in] Integer identifying the error condition that resulted in the exception

Definition at line 66 of file CACException.cpp.

CPKIFException::CPKIFException ( int  subComponentID,
int  errorCode,
char *  file,
int  line 
)

Interface: External

These five constructors provide means of creating exception objects containing various combinations of exception-related information

Returns:
None
Parameters:
subComponentID  [in] Integer identifying the subcomponent that generated the exception
errorCode  [in] Integer identifying the error condition that resulted in the exception
file  [in] Pointer to a NULL terminated string identifying the source file from which the exception was thrown
line  [in] Integer indicating the line number of the source file identified by the fileName parameter from which the exception was thrown

Definition at line 154 of file CACException.cpp.

CPKIFException::CPKIFException ( int  subComponent,
int  errorCode,
const char *  description 
)

Interface: External

These five constructors provide means of creating exception objects containing various combinations of exception-related information

Returns:
None
Parameters:
subComponent  [in] Integer identifying the subcomponent that generated the exception
errorCode  [in] Integer identifying the error condition that resulted in the exception
description  [in] Pointer to a NULL terminated string containing a free form textual description of the error condition that resulted in the exception

Definition at line 87 of file CACException.cpp.

References COMMON_INVALID_INPUT, CPKIFException(), and TOOLKIT_UTILS.

CPKIFException::CPKIFException ( int  subComponent,
int  errorCode,
const char *  description,
char *  file,
int  line 
)

Interface: External

These five constructors provide means of creating exception objects containing various combinations of exception-related information

Returns:
None
Parameters:
subComponent  [in] Integer identifying the subcomponent that generated the exception
errorCode  [in] Integer identifying the error condition that resulted in the exception
description  [in] Pointer to a NULL terminated string containing a free form textual description of the error condition that resulted in the exception
file  [in] Pointer to a NULL terminated string identifying the source file from which the exception was thrown
line  [in] Integer indicating the line number of the source file identified by the fileName parameter from which the exception was thrown

Definition at line 118 of file CACException.cpp.

References COMMON_INVALID_INPUT, CPKIFException(), and TOOLKIT_UTILS.

CPKIFException::~CPKIFException ( void   )  [virtual]

Interface: External

This function destroys CPKIFException objects.

Returns:
None

Definition at line 200 of file CACException.cpp.


Member Function Documentation

void CPKIFException::push_info ( CPKIFException e  ) 

Interface: External

This function can be used to push information from existing information into an exception object of a different type. For example, a CPKIFMessageException object may encapsulate a CPKIFPathProcessingException object This function is seldom used.

Returns:
None
Parameters:
e  [in] Reference to a CPKIFException object to store

Definition at line 216 of file CACException.cpp.

References m_impl.

Referenced by CPKIFEnvelopedData::AddRecipient(), CPKIFSignedData::Decode(), CPKIFEnvelopedData::Decode(), CPKIFEncryptedData::Decode(), CPKIFContentCollection::Decode(), CPKIFContentInfo::Decode(), CPKIFEnvelopedData::Decrypt(), CPKIFContentInfo::Encode(), and CPKIFTimestampVerifier::Verify().

void CPKIFException::GetExceptionInfos ( std::vector< ExceptionInfoPtr > &  v  ) 

Interface: External

Exception objects thrown from one subsystem may be caught by another subsystem. In some cases, the exception from a lower level is preserved by the higher level that catches the exception. For example, a CMS message class may catch a CPKIFCryptoException, store it in a CPKIFMessageException and throw the CPKIFMessageException to the application. This function is used to retrieve exception information that was collected in this manner. In most cases, exceptions are simply propagated to the caller and exception information is not collected. Thus, this function is seldom used.

Returns:
None
Parameters:
v  [out] Reference to a vector of exception information objects to receive the exception information objects accumulated by a CPKIFException object

Definition at line 237 of file CACException.cpp.

int CPKIFException::GetErrorCode (  )  const

Interface: External

This function returns an integer containing the error code value associated with the exception object. Each subcomponent defines a set of errors. The integer space is divided based on subcomponent identifiers, which are defined in components.h. Subcomponents define error codes relative to an error code base value defined for the subcomponent. The currently defined error code base values are as follows:

declare values that govern the definition of values below

define TOOLKIT_SUBCOMPONENT_MULTIPLIER 25 define TOOLKIT_ERROR_MULTIPLIER 500 define TOOLKIT_ERROR_EXTENSIONS 100

ID for each major component of PKIF:

define TOOLKIT_ASN 1 //CACX509ASN.lib define TOOLKIT_CACHE 2 //CACCACHE.lib define TOOLKIT_CRYPTO 3 //CACCRYPTO.lib define TOOLKIT_MESSAGE 4 //CACMESSAGE.lib define TOOLKIT_OCSP 5 //PKIFOCSP.lib define TOOLKIT_PATH 6 //CACPATH.lib define TOOLKIT_TAP 7 //PKIFTAP.lib define TOOLKIT_TSP 8 //PKIFTSP.lib define TOOLKIT_UTILS 9 //CACUTILS.lib define TOOLKIT_APP 10 //other components, app-defined, etc.

error bases - each component defines its own error codes using these values as the base for numbering.

define TOOLKIT_ASN_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_ASN define TOOLKIT_SR_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_CACHE define TOOLKIT_CRYPTO_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_CRYPTO define TOOLKIT_MESSAGE_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_MESSAGE define TOOLKIT_OCSP_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_OCSP define TOOLKIT_PATH_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_PATH define TOOLKIT_TAP_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_TAP define TOOLKIT_TSP_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_TSP define TOOLKIT_UTILS_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_UTILS define TOOLKIT_APP_DEFINED_ERROR_BASE TOOLKIT_ERROR_MULTIPLIER * TOOLKIT_APP

Returns:
An integer indicating Error Code

Definition at line 355 of file CACException.cpp.

Referenced by CPKIFPathBasicChecks2::DoChecks(), GetCertfromLDAPURL(), CPKIFNSSRaw::SupportsAlgorithm(), CPKIFCryptoPPRaw::SupportsAlgorithm(), CPKIFCNGCAPIRaw::SupportsAlgorithm(), CPKIFCAPIRaw::SupportsAlgorithm(), and VerifyCounterSignatures().

int CPKIFException::GetSubcomponentID (  )  const

Interface: External

This function returns an identifier of the component that raised the exception object. Component identifiers are defined in components.h. For convenience, the list of currently defined components is as follows:

ASN-related components

define TOOLKIT_EXTENSION_MEDIATOR TOOLKIT_ASN_SUBCOMPONENT + 1 define TOOLKIT_X509_ASN TOOLKIT_ASN_SUBCOMPONENT + 2

CACCACHE components

define TOOLKIT_SR_MEDIATOR TOOLKIT_SR_SUBCOMPONENT + 1 define TOOLKIT_SR_CAPICERTUPDATE TOOLKIT_SR_SUBCOMPONENT + 2 define TOOLKIT_SR_CAPICRLUPDATE TOOLKIT_SR_SUBCOMPONENT + 3 define TOOLKIT_SR_CAPIREPOSITORY TOOLKIT_SR_SUBCOMPONENT + 4 define TOOLKIT_SR_CAPITRUSTROOTCRLSTORE TOOLKIT_SR_SUBCOMPONENT + 5 define TOOLKIT_SR_CAPITRUSTSTORE TOOLKIT_SR_SUBCOMPONENT + 6 define TOOLKIT_SR_CAPIUSERREPOSITORY TOOLKIT_SR_SUBCOMPONENT + 7 define TOOLKIT_SR_LDAPREPOSITORY TOOLKIT_SR_SUBCOMPONENT + 8 define TOOLKIT_SR_SIMPLECERTCACHE TOOLKIT_SR_SUBCOMPONENT + 9 define TOOLKIT_SR_SIMPLECRLCACHE TOOLKIT_SR_SUBCOMPONENT + 10 define TOOLKIT_SR_SIMPLEROOTSTORE TOOLKIT_SR_SUBCOMPONENT + 11 define TOOLKIT_SR_MISC TOOLKIT_SR_SUBCOMPONENT + 12

CACCRYPTO components

define TOOLKIT_CRYPTO_MEDIATOR TOOLKIT_CRYPTO_SUBCOMPONENT + 1 define TOOLKIT_CRYPTO_CAPICRED TOOLKIT_CRYPTO_SUBCOMPONENT + 2 define TOOLKIT_CRYPTO_CAPI TOOLKIT_CRYPTO_SUBCOMPONENT + 3 define TOOLKIT_CRYPTO_CAPIRAW TOOLKIT_CRYPTO_SUBCOMPONENT + 4 define TOOLKIT_CRYPTO_KEYMATERIAL TOOLKIT_CRYPTO_SUBCOMPONENT + 5 define TOOLKIT_CRYPTO_MISC TOOLKIT_CRYPTO_SUBCOMPONENT + 6

CACMESSAGE components

define TOOLKIT_MESSAGE_SIGNED_DATA TOOLKIT_MESSAGE_SUBCOMPONENT + 1 define TOOLKIT_MESSAGE_ATTR_MEDIATOR TOOLKIT_MESSAGE_SUBCOMPONENT + 2 define TOOLKIT_MESSAGE_ASN TOOLKIT_MESSAGE_SUBCOMPONENT + 3 define TOOLKIT_MESSAGE_PARALLEL_HASH TOOLKIT_MESSAGE_SUBCOMPONENT + 4 define TOOLKIT_MESSAGE_ENVELOPED_DATA TOOLKIT_MESSAGE_SUBCOMPONENT + 5 define TOOLKIT_MESSAGE_CONTENT_INFO TOOLKIT_MESSAGE_SUBCOMPONENT + 6

CACPATH components

define TOOLKIT_PATH_MEDIATOR TOOLKIT_PATH_SUBCOMPONENT + 1 define TOOLKIT_PATH_REV_STATUS_MEDIATOR TOOLKIT_PATH_SUBCOMPONENT + 2 define TOOLKIT_PATH_CRL_CHECKER TOOLKIT_PATH_SUBCOMPONENT + 3 define TOOLKIT_PATH_BASIC_CHECKS TOOLKIT_PATH_SUBCOMPONENT + 4 define TOOLKIT_PATH_BUILDER TOOLKIT_PATH_SUBCOMPONENT + 5 define TOOLKIT_PATH_VALIDATOR TOOLKIT_PATH_SUBCOMPONENT + 6 define TOOLKIT_PATH_MISC TOOLKIT_PATH_SUBCOMPONENT + 7

CACUTILS (plus CACMODULE)

define TOOLKIT_PKIF_DLL TOOLKIT_UTILS_SUBCOMPONENT + 1

PKIFOCSP components

define TOOLKIT_OCSP_ASN TOOLKIT_OCSP_SUBCOMPONENT + 1 define TOOLKIT_OCSP_CHECKER TOOLKIT_OCSP_SUBCOMPONENT + 2

PKIFTAP components

define TOOLKIT_TAP_ASN TOOLKIT_TAP_SUBCOMPONENT + 1

PKIFTSP components

define TOOLKIT_TSP_ASN TOOLKIT_TSP_SUBCOMPONENT + 1 define TOOLKIT_TSP_TIMESTAMP_VERIFIER TOOLKIT_TSP_SUBCOMPONENT + 2

Returns:
An integer indicating the Subcomponent ID

Definition at line 435 of file CACException.cpp.

const char * CPKIFException::GetDescription (  )  const

Interface: External

This function returns a pointer to a NULL-terminated text description of the error condition that resulted in the exception or NULL, if no description is present. The pointer is valid only for the life of the exception object.

Returns:
A pointer to a NULL derminated string.

Definition at line 448 of file CACException.cpp.

Referenced by CPKIFPathBasicChecks2::DoChecks(), PKIFXSECCryptoHash::finish(), PKIFXSECCryptoHash::hash(), PKIFXSECCryptoKeyRSA::privateDecrypt(), PKIFXSECCryptoKeyRSA::publicEncrypt(), PKIFXSECCryptoKeyDSA::signBase64Signature(), PKIFXSECCryptoKeyRSA::signSHA1PKCS1Base64Signature(), PKIFXSECCryptoKeyDSA::verifyBase64Signature(), and PKIFXSECCryptoKeyRSA::verifySHA1PKCS1Base64Signature().

CPKIFStringPtr CPKIFException::print (  )  const


The documentation for this class was generated from the following files:

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