os/security/crypto/weakcryptospi/inc/spi/ruleselector.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/crypto/weakcryptospi/inc/spi/ruleselector.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,604 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* Rule-based plugin selector definition
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 + @publishedAll
    1.26 + @released
    1.27 +*/
    1.28 +
    1.29 +#ifndef __CRYPTOAPI_RULESELECTOR_H__
    1.30 +#define __CRYPTOAPI_RULESELECTOR_H__
    1.31 +
    1.32 +#include <cryptospi/pluginselectorbase.h>
    1.33 +#include <cryptospi/cryptocharacteristics.h>
    1.34 +#include <e32hashtab.h>
    1.35 +#include <cryptospi/cryptoparams.h>
    1.36 +
    1.37 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.38 +#include <rulecharacteristics.h>
    1.39 +#endif
    1.40 +
    1.41 +namespace CryptoSpi
    1.42 +	{
    1.43 +	
    1.44 +	/**
    1.45 +	The operators of the plugin selection rule
    1.46 +	*/
    1.47 +	enum TRuleOperator
    1.48 +		{
    1.49 +		/**
    1.50 +		Operator ==
    1.51 +		*/
    1.52 +		EOpEqual,
    1.53 +
    1.54 +		/**
    1.55 +		Operator !=
    1.56 +		*/
    1.57 +		EOpNotEqual,
    1.58 +
    1.59 +		/**
    1.60 +		Operator >
    1.61 +		*/
    1.62 +		EOpGreaterThan,
    1.63 +
    1.64 +		/**
    1.65 +		Operator <
    1.66 +		*/
    1.67 +		EOpLessThan,
    1.68 +
    1.69 +		/**
    1.70 +		Operator >=
    1.71 +		*/
    1.72 +		EOpGreaterThanOrEqual,
    1.73 +
    1.74 +		/**
    1.75 +		Operator <=
    1.76 +		*/
    1.77 +		EOpLessThanOrEqual,
    1.78 +
    1.79 +		/**
    1.80 +		Ascending Sort of an characteristic
    1.81 +		*/
    1.82 +		EOpAscendingSort,
    1.83 +
    1.84 +		/**
    1.85 +		Descending Sort of an characteristic
    1.86 +		*/
    1.87 +		EOpDescendingSort,
    1.88 +
    1.89 +		/**
    1.90 +		The total number of operators
    1.91 +		*/
    1.92 +		EOpInvalid
    1.93 +		};
    1.94 +		
    1.95 +	class CRulesCharacteristicsAndPluginName;
    1.96 +	/**
    1.97 +	A single plugin selection rule definition
    1.98 +	*/
    1.99 +	NONSHARABLE_CLASS(CSelectionRuleContent) : public CBase
   1.100 +		{
   1.101 +	public:
   1.102 +		/**
   1.103 +		Create a selection rule content instance; the supported characteristic uid's are
   1.104 +		defined in plugincharacteristics.h; the supported operators are defined in ruleselector.h
   1.105 +		@param aInterfaceScope		The Interface scope of this rule
   1.106 +		@param aAlgorithmScope		The Algorithm scope of this rule
   1.107 +		@param aCharacteristicValue	The value of the rule of this characteristic
   1.108 +		@param aOperator			The operator of the rule
   1.109 +		@param aIsOptional			Whether this rule is optional or mandatory
   1.110 +		@return A pointer to a CSelectionRuleContent instance
   1.111 +		*/
   1.112 +		IMPORT_C static CSelectionRuleContent* NewL(TUid aInterfaceScope,
   1.113 +													TUid aAlgorithmScope,
   1.114 +													CCryptoParam* aCharacteristicValue,
   1.115 +													TRuleOperator aOperator,
   1.116 +													TBool aIsOptional);
   1.117 +		/**
   1.118 +		Destructor
   1.119 +		*/
   1.120 +		IMPORT_C ~CSelectionRuleContent();
   1.121 +
   1.122 +		/**
   1.123 +		 * @internalComponent
   1.124 +		 * 
   1.125 +		 * Get the Interface Scope of this rule
   1.126 +		 * @return the Interface Scope Uid of this rule
   1.127 +		 **/
   1.128 +		TUid GetInterfaceScope();
   1.129 +
   1.130 +		/**
   1.131 +		 * @internalComponent
   1.132 +		 * 
   1.133 +		 * Get the Algorithm Scope of this rule
   1.134 +		 * @return the Algorithm Scope Uid of this rule
   1.135 +		 **/
   1.136 +		TUid GetAlgorithmScope();
   1.137 +
   1.138 +		/**
   1.139 +		 * @internalComponent
   1.140 +		 * 
   1.141 +		 * Get the Rule operator
   1.142 +		 * @return The Rule operator
   1.143 +		 **/
   1.144 +		TInt GetOperator();
   1.145 +
   1.146 +		/**
   1.147 +		 * @internalComponent
   1.148 +		 * 
   1.149 +		 * Get the value of the rule of this characteristic 
   1.150 +		 * @return The value of the rule of this characteristic 
   1.151 +		 **/
   1.152 +		const CCryptoParam* GetCharacteristicValue();
   1.153 +
   1.154 +		/**
   1.155 +		 * @internalComponent
   1.156 +		 * 
   1.157 +		 * returns whether the rule is optional
   1.158 +		 * @return Whether the rule is optional
   1.159 +		 **/
   1.160 +		TBool IsOptionalRule();
   1.161 +
   1.162 +	private:
   1.163 +		/**
   1.164 +		Constructor
   1.165 +		*/
   1.166 +		CSelectionRuleContent(TUid aInterfaceScope,
   1.167 +							TUid aAlgorithmScope,
   1.168 +							CCryptoParam* aCharacteristicValue,
   1.169 +							TRuleOperator aOperator,
   1.170 +							TBool aIsOptional);
   1.171 +
   1.172 +		/**
   1.173 +		The scopes of this rule 
   1.174 +		*/
   1.175 +		TUid iInterfaceScope;
   1.176 +		TUid iAlgorithmScope;
   1.177 +
   1.178 +		/**
   1.179 +		The value of the rule of this characteristic 
   1.180 +		*/
   1.181 +		const CCryptoParam* iCharacteristicValue;
   1.182 +		
   1.183 +		/**
   1.184 +		The Operator of the Characteristic
   1.185 +		*/
   1.186 +		TRuleOperator iOperator;
   1.187 +
   1.188 +		/**
   1.189 +		if the rule on this characteristic is optional
   1.190 +		*/
   1.191 +		TBool iIsOptional;
   1.192 +		};
   1.193 +
   1.194 +	
   1.195 +	/**
   1.196 +	Definition of rule-based plugin selection rules
   1.197 +	*/
   1.198 +	NONSHARABLE_CLASS(CSelectionRules) : public CBase
   1.199 +		{
   1.200 +	public:
   1.201 +		/**
   1.202 +		create a Selection Rule instance which will hold the rules to filter the plugins
   1.203 +		@return a pointer to a CSelectionRules instance
   1.204 +		*/
   1.205 +		IMPORT_C static CSelectionRules* NewL();
   1.206 +		
   1.207 +		/**
   1.208 +		Destructor
   1.209 +		*/
   1.210 +		IMPORT_C ~CSelectionRules();
   1.211 +
   1.212 +		/**
   1.213 +		Add a selection rule the this object
   1.214 +		@param aSelectionRule	The rule to be added
   1.215 +		*/
   1.216 +		IMPORT_C void AddSelectionRuleL(CSelectionRuleContent* aSelectionRule);
   1.217 +		
   1.218 +		/**
   1.219 +		 * @internalComponent
   1.220 +		 *
   1.221 +		 * Get the selection rules
   1.222 +		 * @return The reference of the rules
   1.223 +		 **/
   1.224 +		RPointerArray<CSelectionRuleContent>& GetSelectionRules();
   1.225 +
   1.226 +	private:
   1.227 +		/**
   1.228 +		Constructor
   1.229 +		*/
   1.230 +		CSelectionRules();
   1.231 +		
   1.232 +		/**
   1.233 +		a group of plugin rules
   1.234 +		*/
   1.235 +		RPointerArray<CSelectionRuleContent> iRules;
   1.236 +		};
   1.237 +	
   1.238 +	/**
   1.239 +	Selector apply the rule-based selection to find the plugin.
   1.240 +	*/
   1.241 +	NONSHARABLE_CLASS(CRuleSelector) : public CBase, public MPluginSelector
   1.242 +		{
   1.243 +	public:
   1.244 +		/**
   1.245 +		NewL create the ruled-based selector
   1.246 +		@param aRules The Rules to select the plugins
   1.247 +		@return a pointer to a CRuleSelector instance
   1.248 +		*/
   1.249 +		IMPORT_C static CRuleSelector* NewL(CSelectionRules* aRules);
   1.250 +		IMPORT_C static CRuleSelector* NewLC(CSelectionRules* aRules);
   1.251 +		
   1.252 +		/**
   1.253 +		Destructor
   1.254 +		*/
   1.255 +		IMPORT_C ~CRuleSelector();
   1.256 +				
   1.257 +		/**
   1.258 +		 * @deprecated
   1.259 +		 * 
   1.260 +		 * virtual function from MPluginSelector
   1.261 +		 */
   1.262 +		virtual void CreateHashL(CHash*& aHash,
   1.263 +											TUid aAlgorithmUid,
   1.264 +											TUid aOperationMode,
   1.265 +											const CKey* aKey,
   1.266 +											const CCryptoParams* aAlgorithmParams);
   1.267 +		
   1.268 +		//virtual function from MPluginSelector						
   1.269 +		virtual void CreateRandomL(CRandom*& aRandom,
   1.270 +											TUid aAlgorithmUid,
   1.271 +											const CCryptoParams* aAlgorithmParams);
   1.272 +		
   1.273 +		//virtual function from MPluginSelector
   1.274 +		virtual void CreateSymmetricCipherL(CSymmetricCipher*& aCipher,
   1.275 +											TUid aAlgorithmUid,
   1.276 +											const CKey& aKey,
   1.277 +											TUid aCryptoMode,
   1.278 +											TUid aOperationMode,
   1.279 +											TUid aPaddingMode,
   1.280 +											const CCryptoParams* aAlgorithmParams);
   1.281 +		
   1.282 +		//virtual function from MPluginSelector
   1.283 +		virtual void CreateAsymmetricCipherL(CAsymmetricCipher*& aCipher,
   1.284 +											TUid aAlgorithmUid,
   1.285 +											const CKey& aKey,
   1.286 +											TUid aCryptoMode,
   1.287 +											TUid aPaddingMode,									
   1.288 +											const CCryptoParams* aAlgorithmParams);
   1.289 +											
   1.290 +		//virtual function from MPluginSelector
   1.291 +		virtual void CreateSignerL(CSigner*& aSigner,
   1.292 +											TUid aAlgorithmUid,
   1.293 +											const CKey& aKey,
   1.294 +											TUid aPaddingMode,
   1.295 +											const CCryptoParams* aAlgorithmParams);
   1.296 +		
   1.297 +		//virtual function from MPluginSelector
   1.298 +		virtual void CreateVerifierL(CVerifier*& aVerifier,
   1.299 +											TUid aAlgorithmUid,
   1.300 +											const CKey& aKey,
   1.301 +											TUid aPaddingMode,
   1.302 +											const CCryptoParams* aAlgorithmParams);
   1.303 +
   1.304 +		//virtual function from MPluginSelector
   1.305 +		virtual void CreateKeyPairGeneratorL(CKeyPairGenerator*& aKeyPairGenerator,
   1.306 +											TUid aKeyAlgorithmUid,
   1.307 +											const CCryptoParams* aAlgorithmParams);
   1.308 +
   1.309 +		//virtual function from MPluginSelector
   1.310 +		virtual void CreateKeyAgreementL(CKeyAgreement*& aKeyAgreement,
   1.311 +											TUid aAlgorithmUid,
   1.312 +											const CKey& aPrivateKey,
   1.313 +											const CCryptoParams* aAlgorithmParams);
   1.314 +
   1.315 +		/**
   1.316 +		 * @deprecated
   1.317 +		 * 
   1.318 +		 * virtual function from MPluginSelector
   1.319 +		 */
   1.320 +		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   1.321 +										TUid aAlgorithmUid,
   1.322 +										TUid aOperationMode,
   1.323 +										const CKey* aKey,
   1.324 +										const CCryptoParams* aAlgorithmParams);
   1.325 +		
   1.326 +		//virtual function from MPluginSelector
   1.327 +		virtual void CreateAsyncRandomL(CAsyncRandom*& aRandom,
   1.328 +										TUid aAlgorithmUid,
   1.329 +										const CCryptoParams* aAlgorithmParams);
   1.330 +
   1.331 +		//virtual function from MPluginSelector
   1.332 +		virtual void CreateAsyncSymmetricCipherL(CAsyncSymmetricCipher*& aCipher,
   1.333 +										TUid aAlgorithmUid,
   1.334 +										const CKey& aKey,
   1.335 +										TUid aCryptoMode,
   1.336 +										TUid aOperationMode,
   1.337 +										TUid aPaddingMode,
   1.338 +										const CCryptoParams* aAlgorithmParams);
   1.339 +
   1.340 +		//virtual function from MPluginSelector
   1.341 +		virtual void CreateAsyncAsymmetricCipherL(CAsyncAsymmetricCipher*& aCipher,
   1.342 +										TUid aAlgorithmUid,
   1.343 +										const CKey& aKey,
   1.344 +										TUid aCryptoMode,
   1.345 +										TUid aPaddingMode,																						
   1.346 +										const CCryptoParams* aAlgorithmParams);
   1.347 +
   1.348 +		//virtual function from MPluginSelector
   1.349 +		virtual void CreateAsyncSignerL(CAsyncSigner*& aSigner,
   1.350 +										TUid aAlgorithmUid,
   1.351 +										const CKey& aKey,
   1.352 +										TUid aPaddingMode,
   1.353 +										const CCryptoParams* aAlgorithmParams);
   1.354 +		
   1.355 +		//virtual function from MPluginSelector
   1.356 +		virtual void CreateAsyncVerifierL(CAsyncVerifier*& aVerifier,
   1.357 +										TUid aAlgorithmUid,
   1.358 +										const CKey& aKey,
   1.359 +										TUid aPaddingMode,
   1.360 +										const CCryptoParams* aAlgorithmParams);
   1.361 +
   1.362 +		//virtual function from MPluginSelector
   1.363 +		virtual void CreateAsyncKeyPairGeneratorL(CAsyncKeyPairGenerator*& aKeyPairGenerator,
   1.364 +										TUid aAlgorithmUid,
   1.365 +										const CCryptoParams* aAlgorithmParams);
   1.366 +
   1.367 +		//virtual function from MPluginSelector
   1.368 +		virtual void CreateAsyncKeyAgreementL(CAsyncKeyAgreement*& aKeyAgreement,
   1.369 +										TUid aAlgorithmUid,
   1.370 +										const CKey& aPrivateKey,
   1.371 +										const CCryptoParams* aAlgorithmParams);			
   1.372 +	
   1.373 +#ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT	
   1.374 +		
   1.375 +		//virtual function from MPluginSelector	
   1.376 +		virtual void CreateMacL(CMac*& aMac,
   1.377 +								const TUid aAlgorithmUid,
   1.378 +								const CKey& aKey,
   1.379 +								const CCryptoParams* aAlgorithmParams);
   1.380 +				
   1.381 +		//virtual function from MPluginSelector
   1.382 +		virtual void CreateAsyncMacL(CAsyncMac*& aMac,
   1.383 +								const TUid aAlgorithmUid,
   1.384 +								const CKey& aKey,
   1.385 +								const CCryptoParams* aAlgorithmParams);
   1.386 +		
   1.387 +		//virtual function from MPluginSelector
   1.388 +		virtual void CreateHashL(CHash*& aHash,
   1.389 +								TUid aAlgorithmUid,
   1.390 +								const CCryptoParams* aAlgorithmParams);
   1.391 +
   1.392 +		//virtual function from MPluginSelector
   1.393 +		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   1.394 +								TUid aAlgorithmUid,
   1.395 +								const CCryptoParams* aAlgorithmParams);
   1.396 +		
   1.397 +#endif
   1.398 +		
   1.399 +		/** @internalComponent */
   1.400 +		static TInt AscendCreatorName(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.401 +
   1.402 +		/** @internalComponent */
   1.403 +		static TInt DescendCreatorName(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.404 +		
   1.405 +		/** @internalComponent */
   1.406 +		static TInt AscendExtendedTDesC8L(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.407 +		
   1.408 +		/** @internalComponent */
   1.409 +		static TInt DescendExtendedTDesC8L(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.410 +
   1.411 +		/** @internalComponent */
   1.412 +		static TInt AscendMaxConcurrencySupported(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.413 +		
   1.414 +		/** @internalComponent */
   1.415 +		static TInt DescendMaxConcurrencySupported(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.416 +
   1.417 +		/** @internalComponent */
   1.418 +		static TInt AscendLatency(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.419 +
   1.420 +		/** @internalComponent */
   1.421 +		static TInt DescendLatency(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.422 +
   1.423 +		/** @internalComponent */
   1.424 +		static TInt AscendThroughput(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.425 +
   1.426 +		/** @internalComponent */
   1.427 +		static TInt DescendThroughput(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.428 +
   1.429 +		/** @internalComponent */
   1.430 +		static TInt AscendHashBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.431 +
   1.432 +		/** @internalComponent */
   1.433 +		static TInt DescendHashBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.434 +		
   1.435 +		/** @internalComponent */
   1.436 +		static TInt AscendSymmetricCipherBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.437 +
   1.438 +		/** @internalComponent */
   1.439 +		static TInt DescendSymmetricCipherBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.440 +
   1.441 +		/** @internalComponent */
   1.442 +		static TInt AscendHashOutputSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.443 +
   1.444 +		/** @internalComponent */
   1.445 +		static TInt DescendHashOutputSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.446 +		
   1.447 +		/** @internalComponent */
   1.448 +		static TInt AscendRandomBlockingMode(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.449 +
   1.450 +		/** @internalComponent */
   1.451 +		static TInt DescendRandomBlockingMode(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.452 +
   1.453 +		/** @internalComponent */
   1.454 +		static TInt AscendSymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.455 +
   1.456 +		/** @internalComponent */
   1.457 +		static TInt DescendSymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.458 +
   1.459 +		/** @internalComponent */
   1.460 +		static TInt AscendAsymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.461 +
   1.462 +		/** @internalComponent */
   1.463 +		static TInt DescendAsymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.464 +
   1.465 +		/** @internalComponent */
   1.466 +		static TInt AscendAsymmetricSignatureKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.467 +
   1.468 +		/** @internalComponent */
   1.469 +		static TInt DescendAsymmetricSignatureKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.470 +
   1.471 +		/** @internalComponent */
   1.472 +		static TInt AscendSymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.473 +
   1.474 +		/** @internalComponent */
   1.475 +		static TInt DescendSymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.476 +
   1.477 +		/** @internalComponent */
   1.478 +		static TInt AscendAsymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.479 +
   1.480 +		/** @internalComponent */
   1.481 +		static TInt DescendAsymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.482 +
   1.483 +		/** @internalComponent */
   1.484 +		static TInt AscendAsymmetricSignatureKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.485 +
   1.486 +		/** @internalComponent */
   1.487 +		static TInt DescendAsymmetricSignatureKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.488 +
   1.489 +		/** @internalComponent */
   1.490 +		static TInt AscendAsymmetricKeypairGeneratorKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.491 +
   1.492 +		/** @internalComponent */
   1.493 +		static TInt DescendAsymmetricKeypairGeneratorKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.494 +
   1.495 +		/** @internalComponent */
   1.496 +		static TInt AscendExtendedCharacteristicL(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.497 +		
   1.498 +		/** @internalComponent */
   1.499 +		static TInt DescendExtendedCharacteristicL(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   1.500 +	
   1.501 +	private:
   1.502 +
   1.503 +		/**
   1.504 +		Constructor
   1.505 +		@param aRules the Rules to select the plugins
   1.506 +		*/
   1.507 +		CRuleSelector();
   1.508 +
   1.509 +		/**
   1.510 +		Second Phase Constructor
   1.511 +		*/
   1.512 +		void ConstructL(CSelectionRules* aRules);
   1.513 +
   1.514 +		void PerformFilterL(CSelectionRules* aRules);
   1.515 +
   1.516 +		void PerformAlgorithmFilterL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.517 +									CSelectionRuleContent* aRules, TInt& aLastPreference);
   1.518 +
   1.519 +		TBool FilterCommonCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.520 +											CSelectionRuleContent* aRules, TInt& aLastPreference);
   1.521 +
   1.522 +		TBool FilterNonCommonCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.523 +												CSelectionRuleContent* aRules, TInt& aLastPreference);
   1.524 +
   1.525 +		TBool FilterExtendedCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.526 +												CSelectionRuleContent* aRules, TInt& aLastPreference);
   1.527 +
   1.528 +		void FilterTInt32L(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   1.529 +							CSelectionRuleContent* aRules, TInt& aLastPreference, TInt32 aCharValue);
   1.530 +		
   1.531 +		void FilterMultiTInt32L(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristicsDLL,
   1.532 +								CSelectionRuleContent* aRules, TInt& aLastPreference,
   1.533 +								TBool aSupport);
   1.534 +
   1.535 +		void FilterCreatorNameL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.536 +								CSelectionRuleContent* aRules, TInt& aLastPreference);
   1.537 +
   1.538 +		void FilterExtendedTDesC8L(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.539 +									CSelectionRuleContent* aRules, TInt& aLastPreference, const TDesC8& aCharValue);
   1.540 +										
   1.541 +		void FilterTBoolL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   1.542 +							CSelectionRuleContent* aRules, TInt& aLastPreference, TBool aCharValue);
   1.543 +
   1.544 +		void FilterTIntL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   1.545 +							CSelectionRuleContent* aRules, TInt& aLastPreference, TInt aCharValue);
   1.546 +
   1.547 +		void TryAddToOptionalCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   1.548 +										CSelectionRuleContent* aRules);
   1.549 +
   1.550 +		void AddToCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   1.551 +							TInt& aLastPreference);
   1.552 +		
   1.553 +		void AddOptionalToCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics);
   1.554 +		
   1.555 +		void ConstructMapAL();
   1.556 +
   1.557 +		void SetSearchRecord(TUid aInterfaceUid, TInt aValue);
   1.558 +		
   1.559 +		/**
   1.560 +		Loads the crypto plugins
   1.561 +		*/
   1.562 +		void LoadPluginsL();
   1.563 +
   1.564 +		TInt FindPlugin(TUid aInterfaceUid, TUid aAlgorithmUid, TUid& aImplementationId, TFileName& aDllName);
   1.565 +
   1.566 +		/**
   1.567 +		The selection rules to filter the plugins
   1.568 +		*/
   1.569 +		CSelectionRules* iSelectionRules;
   1.570 +
   1.571 +		/**
   1.572 +		Maps of the interface UID and the pointer of algorithm's characteristic array
   1.573 +		They are used alternatively to filter from one array to the other
   1.574 +		The final array will be set to iActiveInterfaceCharacteristics_Map for plugin lookup
   1.575 +		*/
   1.576 +		RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*> iSelectedInterfaceCharacteristics_MapA;
   1.577 +		RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*> iSelectedInterfaceCharacteristics_MapB;
   1.578 +		
   1.579 +		/**
   1.580 +		Pointer of the active map of the interface UID and the characteristic list
   1.581 +		*/
   1.582 +		const RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*>* iActiveInterfaceCharacteristics_Map;
   1.583 +		
   1.584 +		/**
   1.585 +		Records the next index to try
   1.586 +		*/
   1.587 +		RHashMap<TInt32, TInt> iNextTryCharacteristicsIndex;
   1.588 +		
   1.589 +		/**
   1.590 +		To indicate whether to use iSelectedInterfaceCharacteristics_MapA 
   1.591 +		or iSelectedInterfaceCharacteristics_MapA to filter
   1.592 +		*/
   1.593 +		TBool iUseMapAToFilter;
   1.594 +		
   1.595 +		/**
   1.596 +		This is use to indicate whether to alternate the maps for next rule filtering or not
   1.597 +		*/
   1.598 +		TBool iToggleUseMap;
   1.599 +		
   1.600 +		/**
   1.601 +		The plugin DLL list, which holds all the plugin DLLs
   1.602 +		*/
   1.603 +		RArray<RLibrary> iPluginDllList;
   1.604 +		};
   1.605 +	}
   1.606 +
   1.607 +#endif //__CRYPTOAPI_RULESELECTOR_H__