epoc32/include/http/framework/csecuritypolicy.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/http/framework/csecuritypolicy.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/http/framework/csecuritypolicy.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,173 @@
     1.4 -csecuritypolicy.h
     1.5 +// Copyright (c) 2002-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 + @file csecuritypolicy.h
    1.24 + @warning : This file may contain Rose Model ID comments - please do not delete
    1.25 +*/
    1.26 +
    1.27 +#ifndef __CSECURITYPOLICY_H__
    1.28 +#define __CSECURITYPOLICY_H__
    1.29 +
    1.30 +// System includes
    1.31 +#include <e32base.h>
    1.32 +#include <ecom/ecom.h>
    1.33 +#include <stringpool.h>
    1.34 +#include <ssl.h>
    1.35 +#include <wsp/wsptypes.h>
    1.36 +
    1.37 +
    1.38 +//##ModelId=3C4C37E401CE
    1.39 +class MSecurityPolicy
    1.40 +/**
    1.41 +The Security Policy Interface.  This interface class must be the base 
    1.42 +class of a security policy plug-in.
    1.43 +@publishedAll
    1.44 +@released
    1.45 +*/
    1.46 +	{
    1.47 +public:
    1.48 +
    1.49 +/** Intended Usage:	Ask the client to accept or reject a certificate. Not
    1.50 +					applicable to TLS, as the SSL layer does this itself.
    1.51 +					The call is asynchronous, returning the result via the TRequestStatus.
    1.52 +	@param			aServerCert		(in) A structure containing the certificate details.
    1.53 +	@param			aStatus			(out) A status flag used to indicate errors. A value of 0 is used to indicate
    1.54 +									that the cert is untrusted and 1 that it is trusted
    1.55 +*/
    1.56 +	//##ModelId=3C4C37E4020B
    1.57 +	virtual void ValidateUntrustedServerCert(TCertInfo& aServerCert, TRequestStatus& aStatus) const = 0;
    1.58 +
    1.59 +/** Intended Usage:	Cancel a previous request to ask the client to accept or reject
    1.60 +					an untrusted WTLS server certificate.
    1.61 +*/
    1.62 +	//##ModelId=3C4C37E4020A
    1.63 +	virtual void CancelValidateUntrustedServerCert() = 0;
    1.64 +
    1.65 +
    1.66 +/** Intended Usage:	Obtain an array of WTLS cipher suites.  Not applicable to TLS clients.
    1.67 +	@return			An array of cipher suites, consisting of paired bulk encryption
    1.68 +					algorithms and MAC algorithms.  The array must be ordered with
    1.69 +					strongest cipher suites at the start.
    1.70 +*/
    1.71 +	//##ModelId=3C4C37E40201
    1.72 +	virtual const RArray<TWtlsCipherSuite>& GetWtlsCipherSuites() =0;
    1.73 +
    1.74 +/** Intended Usage:	Obtain a list of TLS cipher suites.  Not applicable to WTLS
    1.75 +					clients.
    1.76 +	@return			An descriptor containing a list of the TLS cipher suites. Each cipher suite is a 2 byte pair
    1.77 +*/
    1.78 +	//##ModelId=3C4C37E40200
    1.79 +	virtual const TDesC8& GetTlsCipherSuites() = 0;
    1.80 +
    1.81 +/** Intended Usage:	Obtain the WTLS key exchange suites.  Not applicable
    1.82 +					to TLS clients.
    1.83 +	@return			An array of the WTLS key exchange suites.  The array must be ordered
    1.84 +					with authenticating key exchange suites at the start followed by
    1.85 +					anonymous key exchange suites if desired.  Within each group of keys
    1.86 +					longer keys should precede shorter ones.
    1.87 +*/
    1.88 +	//##ModelId=3C4C37E401FA
    1.89 +	virtual const RArray<TWtlsKeyExchangeSuite>& GetWtlsKeyExchangeSuites() = 0;
    1.90 +
    1.91 +/** Intended Usage:	Obtain arbitrary, named security policy properties, in a generic
    1.92 +					'stringified' form.
    1.93 +	@param			aPropertyName	(in) The policy property name.
    1.94 +	@param			aPropertyValue	(out) The property value. Parsing of the value is
    1.95 +									left to the caller. The caller must close the
    1.96 +									RString.
    1.97 +	@return			An error code: KErrNone if the property exists or KErrNotFound if
    1.98 +					it doesn't.
    1.99 +*/
   1.100 +	//##ModelId=3C4C37E401F7
   1.101 +	virtual TInt GetNamedPolicyProperty(RStringF aPropertyName, RString& aPropertyValue) = 0;
   1.102 +
   1.103 +protected:
   1.104 +/**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
   1.105 + */
   1.106 +	//##ModelId=3C4C37E401F6
   1.107 +	virtual void Reserved1() =0;
   1.108 +
   1.109 +/**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
   1.110 + */
   1.111 +	//##ModelId=3C4C37E401EC
   1.112 +	virtual void Reserved2() =0;
   1.113 +	};
   1.114 +
   1.115 +//##ModelId=3C4C37C50300
   1.116 +class CSecurityPolicy : public CBase, public MSecurityPolicy
   1.117 +/** 
   1.118 +The Security Policy Plug-in API.  This ECOM interface class must be implemented
   1.119 +by each instance of a security policy plug-in.
   1.120 +@publishedAll
   1.121 +@released
   1.122 +*/
   1.123 +	{
   1.124 +public: // methods
   1.125 +
   1.126 +/** Intended Usage:	Factory construction - instantiates the plug-in.
   1.127 +	@param			aStringPool		(in) An open string pool reference that can be used by the plugin.
   1.128 +	@return			The constructed plug-in.
   1.129 +*/
   1.130 +	//##ModelId=3C4C37C503C8
   1.131 +	inline static CSecurityPolicy* NewL(RStringPool aStringPool);
   1.132 +
   1.133 +/** Intended Usage:	Class destructor.
   1.134 +*/
   1.135 +	//##ModelId=3C4C37C503BE
   1.136 +	inline virtual ~CSecurityPolicy();
   1.137 +
   1.138 +
   1.139 +protected: // methods
   1.140 +
   1.141 +/** Intended Usage:	Normal constructor. Creates an instance of the plug-in base.
   1.142 +	@param			aStrPool		(in) An open string pool reference that can be used by the plugin.
   1.143 +	@return			The constructed plug-in base.
   1.144 +*/
   1.145 +	//##ModelId=3C4C37C503B5
   1.146 +	inline CSecurityPolicy(RStringPool aStrPool);
   1.147 +
   1.148 +
   1.149 +/**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
   1.150 + */
   1.151 +	//##ModelId=3C4C37C503B4
   1.152 +	inline virtual void Reserved1();
   1.153 +
   1.154 +/**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
   1.155 + */
   1.156 +	//##ModelId=3C4C37C503AD
   1.157 +	inline virtual void Reserved2();
   1.158 +
   1.159 +protected: // attributes
   1.160 +
   1.161 +	/** The stringpool reference
   1.162 +	*/
   1.163 +	//##ModelId=3C4C37C503AA
   1.164 +	RStringPool iStrPool;
   1.165 +
   1.166 +private: // attributes
   1.167 +
   1.168 +	/** D'tor Key identification required for ECOM
   1.169 +		@internalAll
   1.170 +	*/
   1.171 +	//##ModelId=3C4C37C50396
   1.172 +	TUid iDtor_ID_Key;
   1.173 +	};
   1.174 +
   1.175 +#include <http/framework/csecuritypolicy.inl>
   1.176 +
   1.177 +#endif // __CSECURITYPOLICY_H__