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