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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @file csecuritypolicy.h
18 @warning : This file may contain Rose Model ID comments - please do not delete
21 #ifndef __CSECURITYPOLICY_H__
22 #define __CSECURITYPOLICY_H__
26 #include <ecom/ecom.h>
27 #include <stringpool.h>
29 #include <wsp/wsptypes.h>
32 //##ModelId=3C4C37E401CE
35 The Security Policy Interface. This interface class must be the base
36 class of a security policy plug-in.
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
50 //##ModelId=3C4C37E4020B
51 virtual void ValidateUntrustedServerCert(TCertInfo& aServerCert, TRequestStatus& aStatus) const = 0;
53 /** Intended Usage: Cancel a previous request to ask the client to accept or reject
54 an untrusted WTLS server certificate.
56 //##ModelId=3C4C37E4020A
57 virtual void CancelValidateUntrustedServerCert() = 0;
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.
65 //##ModelId=3C4C37E40201
66 virtual const RArray<TWtlsCipherSuite>& GetWtlsCipherSuites() =0;
68 /** Intended Usage: Obtain a list of TLS cipher suites. Not applicable to WTLS
70 @return An descriptor containing a list of the TLS cipher suites. Each cipher suite is a 2 byte pair
72 //##ModelId=3C4C37E40200
73 virtual const TDesC8& GetTlsCipherSuites() = 0;
75 /** Intended Usage: Obtain the WTLS key exchange suites. Not applicable
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.
82 //##ModelId=3C4C37E401FA
83 virtual const RArray<TWtlsKeyExchangeSuite>& GetWtlsKeyExchangeSuites() = 0;
85 /** Intended Usage: Obtain arbitrary, named security policy properties, in a generic
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
91 @return An error code: KErrNone if the property exists or KErrNotFound if
94 //##ModelId=3C4C37E401F7
95 virtual TInt GetNamedPolicyProperty(RStringF aPropertyName, RString& aPropertyValue) = 0;
98 /** Intended Usage: Reserve a slot in the v-table to preserve future BC
100 //##ModelId=3C4C37E401F6
101 virtual void Reserved1() =0;
103 /** Intended Usage: Reserve a slot in the v-table to preserve future BC
105 //##ModelId=3C4C37E401EC
106 virtual void Reserved2() =0;
109 //##ModelId=3C4C37C50300
110 class CSecurityPolicy : public CBase, public MSecurityPolicy
112 The Security Policy Plug-in API. This ECOM interface class must be implemented
113 by each instance of a security policy plug-in.
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.
124 //##ModelId=3C4C37C503C8
125 inline static CSecurityPolicy* NewL(RStringPool aStringPool);
127 /** Intended Usage: Class destructor.
129 //##ModelId=3C4C37C503BE
130 inline virtual ~CSecurityPolicy();
133 protected: // methods
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.
139 //##ModelId=3C4C37C503B5
140 inline CSecurityPolicy(RStringPool aStrPool);
143 /** Intended Usage: Reserve a slot in the v-table to preserve future BC
145 //##ModelId=3C4C37C503B4
146 inline virtual void Reserved1();
148 /** Intended Usage: Reserve a slot in the v-table to preserve future BC
150 //##ModelId=3C4C37C503AD
151 inline virtual void Reserved2();
153 protected: // attributes
155 /** The stringpool reference
157 //##ModelId=3C4C37C503AA
158 RStringPool iStrPool;
160 private: // attributes
161 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
162 /** D'tor Key identification required for ECOM
165 /** D'tor Key identification required for ECOM
168 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
170 //##ModelId=3C4C37C50396
174 #include <http/framework/csecuritypolicy.inl>
176 #endif // __CSECURITYPOLICY_H__