os/security/cryptomgmtlibs/securitytestfw/inc/ocspsupport.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
 @internalTechnology
sl@0
    24
*/
sl@0
    25
sl@0
    26
#ifndef __OCSPSUPPORT_H__
sl@0
    27
#define __OCSPSUPPORT_H__
sl@0
    28
sl@0
    29
#include <e32std.h>
sl@0
    30
// file duplicated from \\swi\\inc
sl@0
    31
namespace Swi
sl@0
    32
{
sl@0
    33
sl@0
    34
/// The name of the OCSP Support Server
sl@0
    35
_LIT(KOcspSupportServerName,"!OCSPSUPPORTSERVER");
sl@0
    36
sl@0
    37
/// The name of the OCSP Support Executable
sl@0
    38
_LIT(KOcspSupportServerExeName,"OCSPSUPPORT");
sl@0
    39
sl@0
    40
/// The name of the OCSP Support Thread
sl@0
    41
_LIT(KOcspSupportServerThreadName,"OCSPSUPPORTSERVER-THREAD");
sl@0
    42
sl@0
    43
/// The current version of the OCSP Support Server
sl@0
    44
const TInt KOcspSupportServerVersionMajor=0;
sl@0
    45
const TInt KOcspSupportServerVersionMinor=1;
sl@0
    46
const TInt KOcspSupportServerVersionBuild=0;
sl@0
    47
sl@0
    48
/**
sl@0
    49
 * This class is a handle to the server, which uses HTTP to make the OCSP request
sl@0
    50
 */
sl@0
    51
class ROcspHandler : public RSessionBase
sl@0
    52
	{
sl@0
    53
	static const TInt KDefaultBufferSize;
sl@0
    54
public:
sl@0
    55
	/// Connect to the server	
sl@0
    56
	TInt Connect();
sl@0
    57
	
sl@0
    58
	/// Close the connection tothe server
sl@0
    59
	void Close();
sl@0
    60
	
sl@0
    61
	/// Cancel the OCSP request
sl@0
    62
	void CancelRequest();
sl@0
    63
	
sl@0
    64
	/**
sl@0
    65
	 * Get the response data from the OCSP request. This is only valid when SendRequest
sl@0
    66
	 * has been called, and completed with no error. Ownership is transferred to client.
sl@0
    67
	 *
sl@0
    68
	 * @param	aIapOut		The IAP that was used in this request
sl@0
    69
	 * @return	The body of the OCSP response
sl@0
    70
	 */
sl@0
    71
	TPtrC8 GetResponseL(TUint32& aIapOut) const;
sl@0
    72
	
sl@0
    73
	/**
sl@0
    74
	 * Send an OCSP request, using the server.
sl@0
    75
	 * @param	aUri		The URI of the server to send the request to.
sl@0
    76
	 * @param	aRequest	The request data to send.
sl@0
    77
	 * @param	aTimeout	The request timeout value in milliseconds
sl@0
    78
	 * @param	aIap		The IAP to use for this OCSP request
sl@0
    79
	 * @param	aStatus		Request status. On completion contains an error code.
sl@0
    80
	 */
sl@0
    81
	void SendRequest(const TDesC8& aUri, const TDesC8& aRequest, const TInt aTimeout, TUint32 aIap, TRequestStatus& aStatus);
sl@0
    82
sl@0
    83
private:
sl@0
    84
	/// Starts the server which carries out the requests
sl@0
    85
	TInt StartServer();
sl@0
    86
	
sl@0
    87
	
sl@0
    88
	mutable HBufC8* iResultData;
sl@0
    89
	};
sl@0
    90
sl@0
    91
} // namespace Swi
sl@0
    92
sl@0
    93
#endif // #ifndef __OCSPSUPPORT_H__