pkiutilities/ocsp/test/requestlogger.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // A transport that logs the ocsp requests made to a file and then calls another
       
    15 // transport to send the request.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file 
       
    21  @internalTechnology
       
    22 */
       
    23 
       
    24 #ifndef __TOCSP_REQUEST_LOGGER_H__
       
    25 #define __TOCSP_REQUEST_LOGGER_H__
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <ocsp.h>
       
    29 #include <s32file.h>
       
    30 #include "ocsprequestandresponse.h"
       
    31 
       
    32 class CTOCSPRequestLogger : public CBase, public MOCSPTransport
       
    33 	{
       
    34 public:
       
    35 
       
    36 	/** Create a new request logger.  Takes ownership of the transport unless it leaves. */
       
    37 	static CTOCSPRequestLogger* NewL(const TDesC& aRquesteFile, MOCSPTransport* aTransport);
       
    38 
       
    39 private:
       
    40 
       
    41 	// From MOCSPTransport
       
    42 	~CTOCSPRequestLogger();
       
    43 	void SendRequest(const TDesC8& aURI, const TDesC8& aRequest, const TInt aTimeout, TRequestStatus& aStatus);
       
    44 	void CancelRequest();
       
    45 	TPtrC8 GetResponse() const;
       
    46 
       
    47 private:
       
    48 
       
    49 	CTOCSPRequestLogger();
       
    50 	void DoSendRequestL();
       
    51 	void ConstructL(const TDesC& aResponseFile, MOCSPTransport* aTransport);
       
    52 	void LogRequestL(const TDesC8& aURI, const TDesC8& aRequest);
       
    53 
       
    54 private:
       
    55 
       
    56 	RFs				 iFs;
       
    57 	RFileWriteStream iWriteStream;
       
    58 	TInt			 iTotalRequests;
       
    59 	MOCSPTransport*	 iTransport;
       
    60 	};
       
    61 
       
    62 #endif // __TOCSP_TRANSPORT_H__