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