sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __OCSPSUPPORT_H__ sl@0: #define __OCSPSUPPORT_H__ sl@0: sl@0: #include sl@0: // file duplicated from \\swi\\inc sl@0: namespace Swi sl@0: { sl@0: sl@0: /// The name of the OCSP Support Server sl@0: _LIT(KOcspSupportServerName,"!OCSPSUPPORTSERVER"); sl@0: sl@0: /// The name of the OCSP Support Executable sl@0: _LIT(KOcspSupportServerExeName,"OCSPSUPPORT"); sl@0: sl@0: /// The name of the OCSP Support Thread sl@0: _LIT(KOcspSupportServerThreadName,"OCSPSUPPORTSERVER-THREAD"); sl@0: sl@0: /// The current version of the OCSP Support Server sl@0: const TInt KOcspSupportServerVersionMajor=0; sl@0: const TInt KOcspSupportServerVersionMinor=1; sl@0: const TInt KOcspSupportServerVersionBuild=0; sl@0: sl@0: /** sl@0: * This class is a handle to the server, which uses HTTP to make the OCSP request sl@0: */ sl@0: class ROcspHandler : public RSessionBase sl@0: { sl@0: static const TInt KDefaultBufferSize; sl@0: public: sl@0: /// Connect to the server sl@0: TInt Connect(); sl@0: sl@0: /// Close the connection tothe server sl@0: void Close(); sl@0: sl@0: /// Cancel the OCSP request sl@0: void CancelRequest(); sl@0: sl@0: /** sl@0: * Get the response data from the OCSP request. This is only valid when SendRequest sl@0: * has been called, and completed with no error. Ownership is transferred to client. sl@0: * sl@0: * @param aIapOut The IAP that was used in this request sl@0: * @return The body of the OCSP response sl@0: */ sl@0: TPtrC8 GetResponseL(TUint32& aIapOut) const; sl@0: sl@0: /** sl@0: * Send an OCSP request, using the server. sl@0: * @param aUri The URI of the server to send the request to. sl@0: * @param aRequest The request data to send. sl@0: * @param aTimeout The request timeout value in milliseconds sl@0: * @param aIap The IAP to use for this OCSP request sl@0: * @param aStatus Request status. On completion contains an error code. sl@0: */ sl@0: void SendRequest(const TDesC8& aUri, const TDesC8& aRequest, const TInt aTimeout, TUint32 aIap, TRequestStatus& aStatus); sl@0: sl@0: private: sl@0: /// Starts the server which carries out the requests sl@0: TInt StartServer(); sl@0: sl@0: sl@0: mutable HBufC8* iResultData; sl@0: }; sl@0: sl@0: } // namespace Swi sl@0: sl@0: #endif // #ifndef __OCSPSUPPORT_H__