CPKIXCertChainAO Class Reference

class CPKIXCertChainAO : public CActive

This class handles the asynchronous part of the pkix chain validation. It is an active object which handles the asynchronous certificate store operations.

Inherits from

Public Member Functions
~CPKIXCertChainAO ()
void CancelValidate ()
void DoCancel ()
CPKIXCertChainAO * NewL ( MCertStore &, CPKIXCertChainBase &, const RPointerArray < CX509Certificate > &)
CPKIXCertChainAO * NewL ( MCertStore &, CPKIXCertChainBase &, const TUid )
TInt RunError ( TInt )
void RunL ()
void ValidateL ( CPKIXValidationResultBase &, const TTime &, const CArrayPtr < HBufC > *, TRequestStatus &)
Private Member Functions
CPKIXCertChainAO ( MCertStore &, CPKIXCertChainBase &)
CPKIXCertChainAO ( MCertStore &, CPKIXCertChainBase &, const TUid )
void CheckCriticalExtsL ( CPKIXValidationState &, CPKIXValidationResultBase &)
void CheckSignatureAndNameL (const CX509Certificate &, CPKIXValidationState &, CPKIXValidationResultBase &)
void ConstructL (const RPointerArray < CX509Certificate > &)
void CriticalExtsL ( CPKIXValidationState &, const CX509Certificate &)
void DoValidateL ( CPKIXValidationResultBase &, const TTime &, const CArrayPtr < HBufC > *)
void HandleEAddCandidateIntermediateCertsEndL ()
void HandleEAddRootsL ()
void HandleEBuildChainAddCandidateEndL ()
void HandleEBuildChainCertsFromStoreBeginL ()
void HandleEBuildChainCertsFromStoreEndL ()
void HandleEBuildChainStartL ()
void HandleERootsInitializedL ()
void HandleEStoreManagerInitializationL ()
void HandleEStoreManagerInitializedL ()
void HandleEValidateEndL ()
void InitParamsL ()
void ProcessCertsL ( CPKIXValidationState &, CPKIXValidationResultBase &)
void SetParamsL ( CX509Certificate &, const TPtrC8 &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum TState {
EAddRoots , ERootsInitialized , EBuildChainStart , EBuildChainAddCandidateEnd , EBuildChainCertsFromStoreBegin , EBuildChainCertsFromStoreEnd , EAddCandidateIntermediateCertsEnd , EValidateEnd
}
Inherited Enumerations
CActive:TPriority
Private Attributes
TBool iAddIssuerResult
CPKIXChainBuilder * iBuilder
MCertStore * iCertStore
CPKIXCertsFromStore * iCertsFromStoreRoots
TUid iClient
const CArrayPtr < HBufC > * iInitialPolicies
TInt iNumberOfAddedCertificates
TRequestStatus * iOriginalRequestStatus
CPKIXCertChainBase & iPKIXCertChain
CPKIXChainBuilder * iRoots
TState iState
CPKIXValidationResultBase * iValidationResult
TTime iValidationTime
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CPKIXCertChainAO(MCertStore &, CPKIXCertChainBase &)

CPKIXCertChainAO ( MCertStore & aCertStore,
CPKIXCertChainBase & aPKIXCertChain
) [private]

Parameters

MCertStore & aCertStore
CPKIXCertChainBase & aPKIXCertChain

CPKIXCertChainAO(MCertStore &, CPKIXCertChainBase &, const TUid)

CPKIXCertChainAO ( MCertStore & aCertStore,
CPKIXCertChainBase & aPKIXCertChain,
const TUid aClient
) [private]

Parameters

MCertStore & aCertStore
CPKIXCertChainBase & aPKIXCertChain
const TUid aClient

~CPKIXCertChainAO()

~CPKIXCertChainAO ( ) [virtual]

Member Functions Documentation

CancelValidate()

void CancelValidate ( )

CheckCriticalExtsL(CPKIXValidationState &, CPKIXValidationResultBase &)

void CheckCriticalExtsL ( CPKIXValidationState & aState,
CPKIXValidationResultBase & aResult
) const [private]

CheckSignatureAndNameL(const CX509Certificate &, CPKIXValidationState &, CPKIXValidationResultBase &)

void CheckSignatureAndNameL ( const CX509Certificate & aCert,
CPKIXValidationState & aState,
CPKIXValidationResultBase & aResult
) const [private]

ConstructL(const RPointerArray< CX509Certificate > &)

void ConstructL ( const RPointerArray < CX509Certificate > & aRootCerts ) [private]

Parameters

const RPointerArray < CX509Certificate > & aRootCerts

CriticalExtsL(CPKIXValidationState &, const CX509Certificate &)

void CriticalExtsL ( CPKIXValidationState & aState,
const CX509Certificate & aCert
) const [private]

Parameters

CPKIXValidationState & aState
const CX509Certificate & aCert

DoCancel()

void DoCancel ( ) [virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

DoValidateL(CPKIXValidationResultBase &, const TTime &, const CArrayPtr< HBufC > *)

void DoValidateL ( CPKIXValidationResultBase & aValidationResult,
const TTime & aValidationTime,
const CArrayPtr < HBufC > * aInitialPolicies
) [private]

Parameters

CPKIXValidationResultBase & aValidationResult
const TTime & aValidationTime
const CArrayPtr < HBufC > * aInitialPolicies

HandleEAddCandidateIntermediateCertsEndL()

void HandleEAddCandidateIntermediateCertsEndL ( ) [private]

HandleEAddRootsL()

void HandleEAddRootsL ( ) [private]

Creates a list of all the certificates retrieved from the store based on the filter passed.

HandleEBuildChainAddCandidateEndL()

void HandleEBuildChainAddCandidateEndL ( ) [private]

HandleEBuildChainCertsFromStoreBeginL()

void HandleEBuildChainCertsFromStoreBeginL ( ) [private]

HandleEBuildChainCertsFromStoreEndL()

void HandleEBuildChainCertsFromStoreEndL ( ) [private]

HandleEBuildChainStartL()

void HandleEBuildChainStartL ( ) [private]

HandleERootsInitializedL()

void HandleERootsInitializedL ( ) [private]

Adds the list of certificates retrieved from the store, iRoots ( CPKIXChainBuilder ) maintains a templatized list of all the certificates in MPKIXCertSource format.

HandleEStoreManagerInitializationL()

void HandleEStoreManagerInitializationL ( ) [private]

HandleEStoreManagerInitializedL()

void HandleEStoreManagerInitializedL ( ) [private]

HandleEValidateEndL()

void HandleEValidateEndL ( ) [private]

InitParamsL()

void InitParamsL ( ) [private]

NewL(MCertStore &, CPKIXCertChainBase &, const RPointerArray< CX509Certificate > &)

CPKIXCertChainAO * NewL ( MCertStore & aCertStore,
CPKIXCertChainBase & aPKIXCertChain,
const RPointerArray < CX509Certificate > & aRootCerts
) [static]

Parameters

MCertStore & aCertStore
CPKIXCertChainBase & aPKIXCertChain
const RPointerArray < CX509Certificate > & aRootCerts

NewL(MCertStore &, CPKIXCertChainBase &, const TUid)

CPKIXCertChainAO * NewL ( MCertStore & aCertStore,
CPKIXCertChainBase & aPKIXCertChain,
const TUid aClient
) [static]

Parameters

MCertStore & aCertStore
CPKIXCertChainBase & aPKIXCertChain
const TUid aClient

ProcessCertsL(CPKIXValidationState &, CPKIXValidationResultBase &)

void ProcessCertsL ( CPKIXValidationState & aState,
CPKIXValidationResultBase & aResult
) const [private]

RunError(TInt)

TInt RunError ( TInt aError ) [virtual]

Parameters

TInt aError

RunL()

void RunL ( ) [virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

SetParamsL(CX509Certificate &, const TPtrC8 &)

void SetParamsL ( CX509Certificate & aCert,
const TPtrC8 & aEncodedParams
) [private]

Parameters

CX509Certificate & aCert
const TPtrC8 & aEncodedParams

ValidateL(CPKIXValidationResultBase &, const TTime &, const CArrayPtr< HBufC > *, TRequestStatus &)

void ValidateL ( CPKIXValidationResultBase & aValidationResult,
const TTime & aValidationTime,
const CArrayPtr < HBufC > * aInitialPolicies,
TRequestStatus & aStatus
)

Parameters

CPKIXValidationResultBase & aValidationResult
const TTime & aValidationTime
const CArrayPtr < HBufC > * aInitialPolicies
TRequestStatus & aStatus

Member Enumerations Documentation

Enum TState

The states used to know what to do in the RunL function.

Enumerators

EAddRoots
ERootsInitialized
EBuildChainStart
EBuildChainAddCandidateEnd
EBuildChainCertsFromStoreBegin
EBuildChainCertsFromStoreEnd
EAddCandidateIntermediateCertsEnd
EValidateEnd

Member Data Documentation

TBool iAddIssuerResult

TBool iAddIssuerResult [private]

CPKIXChainBuilder * iBuilder

CPKIXChainBuilder * iBuilder [private]

MCertStore * iCertStore

MCertStore * iCertStore [private]

CPKIXCertsFromStore * iCertsFromStoreRoots

CPKIXCertsFromStore * iCertsFromStoreRoots [private]

Ownership of this object is peculiar.

We need this to be a member because it is created and initialized in the EAddRoots handler but is only added to iRoots in the ERootsInitialized handler. iRoots takes ownesrhip of it, so it is set to 0 afterwards.

The only case where the destructor will have to delete it, is when a leave occurs between the EAddRoots and ERootsInitialized states.

TUid iClient

TUid iClient [private]

const CArrayPtr< HBufC > * iInitialPolicies

const CArrayPtr < HBufC > * iInitialPolicies [private]

To store the parameters passed to CPKIXCertChainBase::Validate

TInt iNumberOfAddedCertificates

TInt iNumberOfAddedCertificates [private]

TRequestStatus * iOriginalRequestStatus

TRequestStatus * iOriginalRequestStatus [private]

CPKIXCertChainBase & iPKIXCertChain

CPKIXCertChainBase & iPKIXCertChain [private]

CPKIXChainBuilder * iRoots

CPKIXChainBuilder * iRoots [private]
The roots that we trust. This can be given
  • explicitly : the user gives a set of root certificates at construction time.

  • implicitly : the user gives the uid of the application and the validation code retrieves the root certificates trusted for this application from the certificate store.

TState iState

TState iState [private]

CPKIXValidationResultBase * iValidationResult

CPKIXValidationResultBase * iValidationResult [private]

To store the parameters passed to CPKIXCertChainBase::Validate

TTime iValidationTime

TTime iValidationTime [private]

To store the parameters passed to CPKIXCertChainBase::Validate