epoc32/include/http/framework/csecuritypolicy.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 csecuritypolicy.h
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file csecuritypolicy.h
       
    20  @warning : This file may contain Rose Model ID comments - please do not delete
       
    21 */
       
    22 
       
    23 #ifndef __CSECURITYPOLICY_H__
       
    24 #define __CSECURITYPOLICY_H__
       
    25 
       
    26 // System includes
       
    27 #include <e32base.h>
       
    28 #include <ecom/ecom.h>
       
    29 #include <stringpool.h>
       
    30 #include <ssl.h>
       
    31 #include <wsp/wsptypes.h>
       
    32 
       
    33 
       
    34 //##ModelId=3C4C37E401CE
       
    35 class MSecurityPolicy
       
    36 /**
       
    37 The Security Policy Interface.  This interface class must be the base 
       
    38 class of a security policy plug-in.
       
    39 @publishedAll
       
    40 @released
       
    41 */
       
    42 	{
       
    43 public:
       
    44 
       
    45 /** Intended Usage:	Ask the client to accept or reject a certificate. Not
       
    46 					applicable to TLS, as the SSL layer does this itself.
       
    47 					The call is asynchronous, returning the result via the TRequestStatus.
       
    48 	@param			aServerCert		(in) A structure containing the certificate details.
       
    49 	@param			aStatus			(out) A status flag used to indicate errors. A value of 0 is used to indicate
       
    50 									that the cert is untrusted and 1 that it is trusted
       
    51 */
       
    52 	//##ModelId=3C4C37E4020B
       
    53 	virtual void ValidateUntrustedServerCert(TCertInfo& aServerCert, TRequestStatus& aStatus) const = 0;
       
    54 
       
    55 /** Intended Usage:	Cancel a previous request to ask the client to accept or reject
       
    56 					an untrusted WTLS server certificate.
       
    57 */
       
    58 	//##ModelId=3C4C37E4020A
       
    59 	virtual void CancelValidateUntrustedServerCert() = 0;
       
    60 
       
    61 
       
    62 /** Intended Usage:	Obtain an array of WTLS cipher suites.  Not applicable to TLS clients.
       
    63 	@return			An array of cipher suites, consisting of paired bulk encryption
       
    64 					algorithms and MAC algorithms.  The array must be ordered with
       
    65 					strongest cipher suites at the start.
       
    66 */
       
    67 	//##ModelId=3C4C37E40201
       
    68 	virtual const RArray<TWtlsCipherSuite>& GetWtlsCipherSuites() =0;
       
    69 
       
    70 /** Intended Usage:	Obtain a list of TLS cipher suites.  Not applicable to WTLS
       
    71 					clients.
       
    72 	@return			An descriptor containing a list of the TLS cipher suites. Each cipher suite is a 2 byte pair
       
    73 */
       
    74 	//##ModelId=3C4C37E40200
       
    75 	virtual const TDesC8& GetTlsCipherSuites() = 0;
       
    76 
       
    77 /** Intended Usage:	Obtain the WTLS key exchange suites.  Not applicable
       
    78 					to TLS clients.
       
    79 	@return			An array of the WTLS key exchange suites.  The array must be ordered
       
    80 					with authenticating key exchange suites at the start followed by
       
    81 					anonymous key exchange suites if desired.  Within each group of keys
       
    82 					longer keys should precede shorter ones.
       
    83 */
       
    84 	//##ModelId=3C4C37E401FA
       
    85 	virtual const RArray<TWtlsKeyExchangeSuite>& GetWtlsKeyExchangeSuites() = 0;
       
    86 
       
    87 /** Intended Usage:	Obtain arbitrary, named security policy properties, in a generic
       
    88 					'stringified' form.
       
    89 	@param			aPropertyName	(in) The policy property name.
       
    90 	@param			aPropertyValue	(out) The property value. Parsing of the value is
       
    91 									left to the caller. The caller must close the
       
    92 									RString.
       
    93 	@return			An error code: KErrNone if the property exists or KErrNotFound if
       
    94 					it doesn't.
       
    95 */
       
    96 	//##ModelId=3C4C37E401F7
       
    97 	virtual TInt GetNamedPolicyProperty(RStringF aPropertyName, RString& aPropertyValue) = 0;
       
    98 
       
    99 protected:
       
   100 /**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
       
   101  */
       
   102 	//##ModelId=3C4C37E401F6
       
   103 	virtual void Reserved1() =0;
       
   104 
       
   105 /**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
       
   106  */
       
   107 	//##ModelId=3C4C37E401EC
       
   108 	virtual void Reserved2() =0;
       
   109 	};
       
   110 
       
   111 //##ModelId=3C4C37C50300
       
   112 class CSecurityPolicy : public CBase, public MSecurityPolicy
       
   113 /** 
       
   114 The Security Policy Plug-in API.  This ECOM interface class must be implemented
       
   115 by each instance of a security policy plug-in.
       
   116 @publishedAll
       
   117 @released
       
   118 */
       
   119 	{
       
   120 public: // methods
       
   121 
       
   122 /** Intended Usage:	Factory construction - instantiates the plug-in.
       
   123 	@param			aStringPool		(in) An open string pool reference that can be used by the plugin.
       
   124 	@return			The constructed plug-in.
       
   125 */
       
   126 	//##ModelId=3C4C37C503C8
       
   127 	inline static CSecurityPolicy* NewL(RStringPool aStringPool);
       
   128 
       
   129 /** Intended Usage:	Class destructor.
       
   130 */
       
   131 	//##ModelId=3C4C37C503BE
       
   132 	inline virtual ~CSecurityPolicy();
       
   133 
       
   134 
       
   135 protected: // methods
       
   136 
       
   137 /** Intended Usage:	Normal constructor. Creates an instance of the plug-in base.
       
   138 	@param			aStrPool		(in) An open string pool reference that can be used by the plugin.
       
   139 	@return			The constructed plug-in base.
       
   140 */
       
   141 	//##ModelId=3C4C37C503B5
       
   142 	inline CSecurityPolicy(RStringPool aStrPool);
       
   143 
       
   144 
       
   145 /**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
       
   146  */
       
   147 	//##ModelId=3C4C37C503B4
       
   148 	inline virtual void Reserved1();
       
   149 
       
   150 /**	Intended Usage:	Reserve a slot in the v-table to preserve future BC
       
   151  */
       
   152 	//##ModelId=3C4C37C503AD
       
   153 	inline virtual void Reserved2();
       
   154 
       
   155 protected: // attributes
       
   156 
       
   157 	/** The stringpool reference
       
   158 	*/
       
   159 	//##ModelId=3C4C37C503AA
       
   160 	RStringPool iStrPool;
       
   161 
       
   162 private: // attributes
       
   163 
       
   164 	/** D'tor Key identification required for ECOM
       
   165 		@internalAll
       
   166 	*/
       
   167 	//##ModelId=3C4C37C50396
       
   168 	TUid iDtor_ID_Key;
       
   169 	};
       
   170 
       
   171 #include <http/framework/csecuritypolicy.inl>
       
   172 
       
   173 #endif // __CSECURITYPOLICY_H__