williamr@2: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file csecuritypolicy.h williamr@2: @warning : This file may contain Rose Model ID comments - please do not delete williamr@2: */ williamr@2: williamr@2: #ifndef __CSECURITYPOLICY_H__ williamr@2: #define __CSECURITYPOLICY_H__ williamr@2: williamr@2: // System includes williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: //##ModelId=3C4C37E401CE williamr@2: class MSecurityPolicy williamr@2: /** williamr@2: The Security Policy Interface. This interface class must be the base williamr@2: class of a security policy plug-in. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: williamr@2: /** Intended Usage: Ask the client to accept or reject a certificate. Not williamr@2: applicable to TLS, as the SSL layer does this itself. williamr@2: The call is asynchronous, returning the result via the TRequestStatus. williamr@2: @param aServerCert (in) A structure containing the certificate details. williamr@2: @param aStatus (out) A status flag used to indicate errors. A value of 0 is used to indicate williamr@2: that the cert is untrusted and 1 that it is trusted williamr@2: */ williamr@2: //##ModelId=3C4C37E4020B williamr@2: virtual void ValidateUntrustedServerCert(TCertInfo& aServerCert, TRequestStatus& aStatus) const = 0; williamr@2: williamr@2: /** Intended Usage: Cancel a previous request to ask the client to accept or reject williamr@2: an untrusted WTLS server certificate. williamr@2: */ williamr@2: //##ModelId=3C4C37E4020A williamr@2: virtual void CancelValidateUntrustedServerCert() = 0; williamr@2: williamr@2: williamr@2: /** Intended Usage: Obtain an array of WTLS cipher suites. Not applicable to TLS clients. williamr@2: @return An array of cipher suites, consisting of paired bulk encryption williamr@2: algorithms and MAC algorithms. The array must be ordered with williamr@2: strongest cipher suites at the start. williamr@2: */ williamr@2: //##ModelId=3C4C37E40201 williamr@2: virtual const RArray& GetWtlsCipherSuites() =0; williamr@2: williamr@2: /** Intended Usage: Obtain a list of TLS cipher suites. Not applicable to WTLS williamr@2: clients. williamr@2: @return An descriptor containing a list of the TLS cipher suites. Each cipher suite is a 2 byte pair williamr@2: */ williamr@2: //##ModelId=3C4C37E40200 williamr@2: virtual const TDesC8& GetTlsCipherSuites() = 0; williamr@2: williamr@2: /** Intended Usage: Obtain the WTLS key exchange suites. Not applicable williamr@2: to TLS clients. williamr@2: @return An array of the WTLS key exchange suites. The array must be ordered williamr@2: with authenticating key exchange suites at the start followed by williamr@2: anonymous key exchange suites if desired. Within each group of keys williamr@2: longer keys should precede shorter ones. williamr@2: */ williamr@2: //##ModelId=3C4C37E401FA williamr@2: virtual const RArray& GetWtlsKeyExchangeSuites() = 0; williamr@2: williamr@2: /** Intended Usage: Obtain arbitrary, named security policy properties, in a generic williamr@2: 'stringified' form. williamr@2: @param aPropertyName (in) The policy property name. williamr@2: @param aPropertyValue (out) The property value. Parsing of the value is williamr@2: left to the caller. The caller must close the williamr@2: RString. williamr@2: @return An error code: KErrNone if the property exists or KErrNotFound if williamr@2: it doesn't. williamr@2: */ williamr@2: //##ModelId=3C4C37E401F7 williamr@2: virtual TInt GetNamedPolicyProperty(RStringF aPropertyName, RString& aPropertyValue) = 0; williamr@2: williamr@2: protected: williamr@2: /** Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37E401F6 williamr@2: virtual void Reserved1() =0; williamr@2: williamr@2: /** Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37E401EC williamr@2: virtual void Reserved2() =0; williamr@2: }; williamr@2: williamr@2: //##ModelId=3C4C37C50300 williamr@2: class CSecurityPolicy : public CBase, public MSecurityPolicy williamr@2: /** williamr@2: The Security Policy Plug-in API. This ECOM interface class must be implemented williamr@2: by each instance of a security policy plug-in. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: // methods williamr@2: williamr@2: /** Intended Usage: Factory construction - instantiates the plug-in. williamr@2: @param aStringPool (in) An open string pool reference that can be used by the plugin. williamr@2: @return The constructed plug-in. williamr@2: */ williamr@2: //##ModelId=3C4C37C503C8 williamr@2: inline static CSecurityPolicy* NewL(RStringPool aStringPool); williamr@2: williamr@2: /** Intended Usage: Class destructor. williamr@2: */ williamr@2: //##ModelId=3C4C37C503BE williamr@2: inline virtual ~CSecurityPolicy(); williamr@2: williamr@2: williamr@2: protected: // methods williamr@2: williamr@2: /** Intended Usage: Normal constructor. Creates an instance of the plug-in base. williamr@2: @param aStrPool (in) An open string pool reference that can be used by the plugin. williamr@2: @return The constructed plug-in base. williamr@2: */ williamr@2: //##ModelId=3C4C37C503B5 williamr@2: inline CSecurityPolicy(RStringPool aStrPool); williamr@2: williamr@2: williamr@2: /** Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37C503B4 williamr@2: inline virtual void Reserved1(); williamr@2: williamr@2: /** Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37C503AD williamr@2: inline virtual void Reserved2(); williamr@2: williamr@2: protected: // attributes williamr@2: williamr@2: /** The stringpool reference williamr@2: */ williamr@2: //##ModelId=3C4C37C503AA williamr@2: RStringPool iStrPool; williamr@2: williamr@2: private: // attributes williamr@2: williamr@2: /** D'tor Key identification required for ECOM williamr@2: @internalAll williamr@2: */ williamr@2: //##ModelId=3C4C37C50396 williamr@2: TUid iDtor_ID_Key; williamr@2: }; williamr@2: williamr@2: #include williamr@2: williamr@2: #endif // __CSECURITYPOLICY_H__