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