1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptomgmtlibs/securitytestfw/inc/ocspsupport.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,93 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +/**
1.25 + @file
1.26 + @internalTechnology
1.27 +*/
1.28 +
1.29 +#ifndef __OCSPSUPPORT_H__
1.30 +#define __OCSPSUPPORT_H__
1.31 +
1.32 +#include <e32std.h>
1.33 +// file duplicated from \\swi\\inc
1.34 +namespace Swi
1.35 +{
1.36 +
1.37 +/// The name of the OCSP Support Server
1.38 +_LIT(KOcspSupportServerName,"!OCSPSUPPORTSERVER");
1.39 +
1.40 +/// The name of the OCSP Support Executable
1.41 +_LIT(KOcspSupportServerExeName,"OCSPSUPPORT");
1.42 +
1.43 +/// The name of the OCSP Support Thread
1.44 +_LIT(KOcspSupportServerThreadName,"OCSPSUPPORTSERVER-THREAD");
1.45 +
1.46 +/// The current version of the OCSP Support Server
1.47 +const TInt KOcspSupportServerVersionMajor=0;
1.48 +const TInt KOcspSupportServerVersionMinor=1;
1.49 +const TInt KOcspSupportServerVersionBuild=0;
1.50 +
1.51 +/**
1.52 + * This class is a handle to the server, which uses HTTP to make the OCSP request
1.53 + */
1.54 +class ROcspHandler : public RSessionBase
1.55 + {
1.56 + static const TInt KDefaultBufferSize;
1.57 +public:
1.58 + /// Connect to the server
1.59 + TInt Connect();
1.60 +
1.61 + /// Close the connection tothe server
1.62 + void Close();
1.63 +
1.64 + /// Cancel the OCSP request
1.65 + void CancelRequest();
1.66 +
1.67 + /**
1.68 + * Get the response data from the OCSP request. This is only valid when SendRequest
1.69 + * has been called, and completed with no error. Ownership is transferred to client.
1.70 + *
1.71 + * @param aIapOut The IAP that was used in this request
1.72 + * @return The body of the OCSP response
1.73 + */
1.74 + TPtrC8 GetResponseL(TUint32& aIapOut) const;
1.75 +
1.76 + /**
1.77 + * Send an OCSP request, using the server.
1.78 + * @param aUri The URI of the server to send the request to.
1.79 + * @param aRequest The request data to send.
1.80 + * @param aTimeout The request timeout value in milliseconds
1.81 + * @param aIap The IAP to use for this OCSP request
1.82 + * @param aStatus Request status. On completion contains an error code.
1.83 + */
1.84 + void SendRequest(const TDesC8& aUri, const TDesC8& aRequest, const TInt aTimeout, TUint32 aIap, TRequestStatus& aStatus);
1.85 +
1.86 +private:
1.87 + /// Starts the server which carries out the requests
1.88 + TInt StartServer();
1.89 +
1.90 +
1.91 + mutable HBufC8* iResultData;
1.92 + };
1.93 +
1.94 +} // namespace Swi
1.95 +
1.96 +#endif // #ifndef __OCSPSUPPORT_H__