CWTLSCertChainAO Class Reference

class CWTLSCertChainAO : public CActive

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

Inherits from

Public Member Functions
~CWTLSCertChainAO()
voidDoCancel()
CWTLSCertChainAO *NewL(RFs &, CWTLSCertChain &, const CArrayPtr< CWTLSCertificate > &)
CWTLSCertChainAO *NewL(RFs &, CWTLSCertChain &, const TUid)
TInt RunError(TInt)
voidRunL()
voidValidate(CWTLSValidationResult &, const TTime &, TRequestStatus &)
Private Member Functions
CWTLSCertChainAO(RFs &, CWTLSCertChain &)
CWTLSCertChainAO(RFs &, CWTLSCertChain &, const TUid)
TBool CheckSignatureAndNameL(const CWTLSCertificate &, CWTLSValidationResult &, TInt)
TBool CheckValidityPeriod(const CWTLSCertificate &, CWTLSValidationResult &, const TTime, TInt)
voidConstructL(const CArrayPtr< CWTLSCertificate > &)
HBufC8 &GeneratePublicKeyHashL(const CWTLSCertificate &)
voidHandleEAddRootToListL()
voidHandleECheckTCAL()
voidHandleEFindRootL()
voidHandleEGetCertHashesL()
voidHandleEIsChainSelfSignedL()
voidHandleEPruneListDoneL()
voidHandleEPruneListL()
voidHandleERetrieveRootsL()
voidHandleEStoreManagerInitializationL()
voidHandleEStoreManagerInitializedL()
voidHandleEValidateEndL()
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
enumTState {
EStoreManagerInitialization = 0, EStoreManagerInitialized, EGetCertHashes, EPruneList, EPruneListDone, ECheckTCA, EIsChainSelfSigned, ERetrieveRoots, EAddRootToList, EFindRoot, EValidateEnd
}
Inherited Enumerations
CActive:TPriority
Private Attributes
RMPointerArray< CCTCertInfo >iCertInfos
CUnifiedCertStore *iCertStoreManager
TUid iClient
TPtr8 iEncodedCert
HBufC8 *iEncodedCertTemp
CCertAttributeFilter *iFilter
TBool iFoundRoot
RFs &iFs
TInt iIndex
TRequestStatus *iOriginalRequestStatus
TBool iPruned
TInt iPrunedChainLength
RPointerArray< HBufC8 >iRootSubjectClientHashList
RPointerArray< TBuf8< 20 > >iRootSubjectStoreHashList
RPointerArray< CWTLSCertificate >iRootsFromClient
RPointerArray< CWTLSCertificate >iRootsFromStore
TState iState
CWTLSValidationResult *iValidationResult
const TTime *iValidationTime
CWTLSCertChain &iWTLSCertChain
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CWTLSCertChainAO(RFs &, CWTLSCertChain &)

CWTLSCertChainAO(RFs &aFs,
CWTLSCertChain &aWTLSCertChain
)[private]

Parameters

RFs & aFs
CWTLSCertChain & aWTLSCertChain

CWTLSCertChainAO(RFs &, CWTLSCertChain &, const TUid)

CWTLSCertChainAO(RFs &aFs,
CWTLSCertChain &aWTLSCertChain,
const TUidaClient
)[private]

Parameters

RFs & aFs
CWTLSCertChain & aWTLSCertChain
const TUid aClient

~CWTLSCertChainAO()

~CWTLSCertChainAO()[virtual]

Member Functions Documentation

CheckSignatureAndNameL(const CWTLSCertificate &, CWTLSValidationResult &, TInt)

TBool CheckSignatureAndNameL(const CWTLSCertificate &aCert,
CWTLSValidationResult &aResult,
TIntaPos
)const [private]

Parameters

const CWTLSCertificate & aCert
CWTLSValidationResult & aResult
TInt aPos

CheckValidityPeriod(const CWTLSCertificate &, CWTLSValidationResult &, const TTime, TInt)

TBool CheckValidityPeriod(const CWTLSCertificate &aCert,
CWTLSValidationResult &aResult,
const TTimeaTime,
TIntaPos
)const [private]

Parameters

const CWTLSCertificate & aCert
CWTLSValidationResult & aResult
const TTime aTime
TInt aPos

ConstructL(const CArrayPtr< CWTLSCertificate > &)

voidConstructL(const CArrayPtr< CWTLSCertificate > &aRootCerts)[private]

Parameters

const CArrayPtr< CWTLSCertificate > & aRootCerts

DoCancel()

voidDoCancel()[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

GeneratePublicKeyHashL(const CWTLSCertificate &)

HBufC8 &GeneratePublicKeyHashL(const CWTLSCertificate &aCert)const [private]

Parameters

const CWTLSCertificate & aCert

HandleEAddRootToListL()

voidHandleEAddRootToListL()[private]

HandleECheckTCAL()

voidHandleECheckTCAL()[private]

HandleEFindRootL()

voidHandleEFindRootL()[private]

HandleEGetCertHashesL()

voidHandleEGetCertHashesL()[private]

HandleEIsChainSelfSignedL()

voidHandleEIsChainSelfSignedL()[private]

HandleEPruneListDoneL()

voidHandleEPruneListDoneL()[private]

HandleEPruneListL()

voidHandleEPruneListL()[private]

HandleERetrieveRootsL()

voidHandleERetrieveRootsL()[private]

HandleEStoreManagerInitializationL()

voidHandleEStoreManagerInitializationL()[private]

This function creates a CCertStoreManager, calls CCertStoreManager initialise and sets the state to EStoreManagerInitialized

HandleEStoreManagerInitializedL()

voidHandleEStoreManagerInitializedL()[private]

HandleEValidateEndL()

voidHandleEValidateEndL()[private]

NewL(RFs &, CWTLSCertChain &, const CArrayPtr< CWTLSCertificate > &)

CWTLSCertChainAO *NewL(RFs &aFs,
CWTLSCertChain &aWTLSCertChain,
const CArrayPtr< CWTLSCertificate > &aRootCerts
)[static]

Parameters

RFs & aFs
CWTLSCertChain & aWTLSCertChain
const CArrayPtr< CWTLSCertificate > & aRootCerts

NewL(RFs &, CWTLSCertChain &, const TUid)

CWTLSCertChainAO *NewL(RFs &aFs,
CWTLSCertChain &aWTLSCertChain,
const TUidaClient
)[static]

Parameters

RFs & aFs
CWTLSCertChain & aWTLSCertChain
const TUid aClient

RunError(TInt)

TInt RunError(TIntaError)[virtual]

Parameters

TInt aError

RunL()

voidRunL()[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

Validate(CWTLSValidationResult &, const TTime &, TRequestStatus &)

voidValidate(CWTLSValidationResult &aValidationResult,
const TTime &aValidationTime,
TRequestStatus &aStatus
)

Parameters

CWTLSValidationResult & aValidationResult
const TTime & aValidationTime
TRequestStatus & aStatus

Member Enumerations Documentation

Enum TState

Enumerators

EStoreManagerInitialization = 0
EStoreManagerInitialized
EGetCertHashes
EPruneList
EPruneListDone
ECheckTCA
EIsChainSelfSigned
ERetrieveRoots
EAddRootToList
EFindRoot
EValidateEnd

Member Data Documentation

RMPointerArray< CCTCertInfo > iCertInfos

RMPointerArray< CCTCertInfo >iCertInfos[private]

Stores info on the certs in the cert store We own this object and all its elements

CUnifiedCertStore * iCertStoreManager

CUnifiedCertStore *iCertStoreManager[private]

TUid iClient

TUid iClient[private]

TPtr8 iEncodedCert

TPtr8 iEncodedCert[private]

HBufC8 * iEncodedCertTemp

HBufC8 *iEncodedCertTemp[private]

CCertAttributeFilter * iFilter

CCertAttributeFilter *iFilter[private]

TBool iFoundRoot

TBool iFoundRoot[private]

Indicates if a root cert has been found for this particular chain

RFs & iFs

RFs &iFs[private]

TInt iIndex

TInt iIndex[private]

A counter used to carry counter information between AO states

TRequestStatus * iOriginalRequestStatus

TRequestStatus *iOriginalRequestStatus[private]

TBool iPruned

TBool iPruned[private]

Indicates whether iWTLSCertChain.iChain was pruned or not

TInt iPrunedChainLength

TInt iPrunedChainLength[private]

The index within iChain that the chain was pruned

RPointerArray< HBufC8 > iRootSubjectClientHashList

RPointerArray< HBufC8 >iRootSubjectClientHashList[private]

List of the subject hashes from the passed in certs We own this object and all its elements

RPointerArray< TBuf8< 20 > > iRootSubjectStoreHashList

RPointerArray< TBuf8< 20 > >iRootSubjectStoreHashList[private]

List of the subject hashes from the cert store The elements remained owned by the CCTCertInfo

RPointerArray< CWTLSCertificate > iRootsFromClient

RPointerArray< CWTLSCertificate >iRootsFromClient[private]

Roots passed in from the client that we trust We own this object and all its elements

RPointerArray< CWTLSCertificate > iRootsFromStore

RPointerArray< CWTLSCertificate >iRootsFromStore[private]

Roots from the specified cert store that we trust. We own this object and all its elements

TState iState

TState iState[private]

CWTLSValidationResult * iValidationResult

CWTLSValidationResult *iValidationResult[private]

To store the parameters passed to CWTLSCertChain::Validate

const TTime * iValidationTime

const TTime *iValidationTime[private]

To store the parameters passed to CWTLSCertChain::Validate

CWTLSCertChain & iWTLSCertChain

CWTLSCertChain &iWTLSCertChain[private]