COCSPClient Class Reference

class COCSPClient : public CActive

Checks the revocation state of one or more certificates.

The current implementation makes one OCSP request for every certificate checked - future impelementations may check multiple certificates with a single request.

Inherits from

Public Member Functions
~COCSPClient()
IMPORT_C voidCancelCheck(void)
IMPORT_C TBoolCertsAvailableForOCSPCheck()
IMPORT_C voidCheck(TRequestStatus &)
IMPORT_C COCSPClient *NewL(const COCSPParameters *)
IMPORT_C const TOCSPOutcome &Outcome(TInt)
IMPORT_C const COCSPRequest &Request(TInt)
IMPORT_C const COCSPResponse *Response(TInt)
IMPORT_C OCSP::TResultSummaryResult(void)
IMPORT_C TIntTransactionCount(void)
Protected Member Functions
voidDoCancel()
TInt RunError(TInt)
voidRunL()
Private Member Functions
COCSPClient()
voidConstructL(const COCSPParameters *)
voidDestroy()
voidDoCheck()
voidDoSendRequestL()
voidHandleResponseReceivedL()
voidHandleResponseValidatedL()
voidHandleTransactionErrorL(OCSP::TStatus)
voidSendRequest()
voidValidateResponseL()
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 { EInitial, ESendingRequest, EValidatingResponse, EHaveResult, EError }
Inherited Enumerations
CActive:TPriority
Private Attributes
TRequestStatus *iClientStatus
RArray< TOCSPOutcome >iOutcomes
const COCSPParameters *iParams
RPointerArray< COCSPRequest >iRequests
RPointerArray< COCSPResponse >iResponses
TState iState
OCSP::TResult iSummaryResult
COCSPTransaction *iTransaction
MOCSPTransport *iTransport
const TDesC8 *iURI
COCSPValidator *iValidator
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

COCSPClient()

COCSPClient()[private]

~COCSPClient()

~COCSPClient()

Member Functions Documentation

CancelCheck(void)

IMPORT_C voidCancelCheck(void)

Cancel checking.

Parameters

void

CertsAvailableForOCSPCheck()

IMPORT_C TBoolCertsAvailableForOCSPCheck()

Check(TRequestStatus &)

IMPORT_C voidCheck(TRequestStatus &aStatus)

Start the checker - this is an asynchronous method.

Parameters

TRequestStatus & aStatus

ConstructL(const COCSPParameters *)

voidConstructL(const COCSPParameters *aParams)[private]

Parameters

const COCSPParameters * aParams

Destroy()

voidDestroy()[private]

DoCancel()

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

DoCheck()

voidDoCheck()[private]

DoSendRequestL()

voidDoSendRequestL()[private]

HandleResponseReceivedL()

voidHandleResponseReceivedL()[private]

Receive the response, if the response was received correctly, perform validation based on the scheme in use.

HandleResponseValidatedL()

voidHandleResponseValidatedL()[private]

Following is the sequence followed in this method: 1. Check the result for validation of the current response and update the Summary result accordingly. 2. If delegate certificate has to be checked further initiate the same. 3. if all request have not been processed then start validation for the next request. 4. If all request have been processed complete the original client request.

HandleTransactionErrorL(OCSP::TStatus)

voidHandleTransactionErrorL(OCSP::TStatusaStatus)[private]

Called when there's an error getting a response, and it's one of our non-fatal errors. We record the error and continue checking.

Parameters

OCSP::TStatus aStatus

NewL(const COCSPParameters *)

IMPORT_C COCSPClient *NewL(const COCSPParameters *aParams)[static]

Create a new OCSP client.

Parameters

const COCSPParameters * aParamsAn object describing the parameters for the check. This method takes ownership if it does not leave.

Outcome(TInt)

IMPORT_C const TOCSPOutcome &Outcome(TIntaIndex)const

Get the outcome for an individual transaction.

Parameters

TInt aIndex

Request(TInt)

IMPORT_C const COCSPRequest &Request(TIntaIndex)const

Get the request object for a specified transaction. Panics if the check has not been run, is not complete, or the index is invalid.

Parameters

TInt aIndex

Response(TInt)

IMPORT_C const COCSPResponse *Response(TIntaIndex)const

Get the response object for a specified transaction. If there was an error sending the request, this may return NULL for the corresponding response. Panics if the check has not been run, is not complete, or the index is invalid.

Parameters

TInt aIndex

RunError(TInt)

TInt RunError(TIntaErr)[protected, virtual]

Parameters

TInt aErr

RunL()

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

SendRequest()

voidSendRequest()[private]

SummaryResult(void)

IMPORT_C OCSP::TResultSummaryResult(void)const

Get the summary result of the check. If any certificates were revoked, this returns ERevoked. If no certificates were revoked, but if there were any errors communicating with ocsp servers or any certs had unknown status, this returns EUnknown. Otherwise it returns EGood. Panics if the check has not been run, or is not complete.

Parameters

void

TransactionCount(void)

IMPORT_C TIntTransactionCount(void)const

Get the number of transactions made. Panics if the check has not been run, or is not complete.

Parameters

void

ValidateResponseL()

voidValidateResponseL()[private]

Each response received has to undergo validation based on RFC 2560 guidelines.

Member Enumerations Documentation

Enum TState

Enumerators

EInitial
ESendingRequest
EValidatingResponse
EHaveResult
EError

Member Data Documentation

TRequestStatus * iClientStatus

TRequestStatus *iClientStatus[private]

RArray< TOCSPOutcome > iOutcomes

RArray< TOCSPOutcome >iOutcomes[private]

const COCSPParameters * iParams

const COCSPParameters *iParams[private]

RPointerArray< COCSPRequest > iRequests

RPointerArray< COCSPRequest >iRequests[private]

RPointerArray< COCSPResponse > iResponses

RPointerArray< COCSPResponse >iResponses[private]

TState iState

TState iState[private]

OCSP::TResult iSummaryResult

OCSP::TResult iSummaryResult[private]

COCSPTransaction * iTransaction

COCSPTransaction *iTransaction[private]

MOCSPTransport * iTransport

MOCSPTransport *iTransport[private]

const TDesC8 * iURI

const TDesC8 *iURI[private]

COCSPValidator * iValidator

COCSPValidator *iValidator[private]