os/security/crypto/weakcryptospi/inc/spi/ruleselector.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * Rule-based plugin selector definition
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @publishedAll
    23  @released
    24 */
    25 
    26 #ifndef __CRYPTOAPI_RULESELECTOR_H__
    27 #define __CRYPTOAPI_RULESELECTOR_H__
    28 
    29 #include <cryptospi/pluginselectorbase.h>
    30 #include <cryptospi/cryptocharacteristics.h>
    31 #include <e32hashtab.h>
    32 #include <cryptospi/cryptoparams.h>
    33 
    34 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    35 #include <rulecharacteristics.h>
    36 #endif
    37 
    38 namespace CryptoSpi
    39 	{
    40 	
    41 	/**
    42 	The operators of the plugin selection rule
    43 	*/
    44 	enum TRuleOperator
    45 		{
    46 		/**
    47 		Operator ==
    48 		*/
    49 		EOpEqual,
    50 
    51 		/**
    52 		Operator !=
    53 		*/
    54 		EOpNotEqual,
    55 
    56 		/**
    57 		Operator >
    58 		*/
    59 		EOpGreaterThan,
    60 
    61 		/**
    62 		Operator <
    63 		*/
    64 		EOpLessThan,
    65 
    66 		/**
    67 		Operator >=
    68 		*/
    69 		EOpGreaterThanOrEqual,
    70 
    71 		/**
    72 		Operator <=
    73 		*/
    74 		EOpLessThanOrEqual,
    75 
    76 		/**
    77 		Ascending Sort of an characteristic
    78 		*/
    79 		EOpAscendingSort,
    80 
    81 		/**
    82 		Descending Sort of an characteristic
    83 		*/
    84 		EOpDescendingSort,
    85 
    86 		/**
    87 		The total number of operators
    88 		*/
    89 		EOpInvalid
    90 		};
    91 		
    92 	class CRulesCharacteristicsAndPluginName;
    93 	/**
    94 	A single plugin selection rule definition
    95 	*/
    96 	NONSHARABLE_CLASS(CSelectionRuleContent) : public CBase
    97 		{
    98 	public:
    99 		/**
   100 		Create a selection rule content instance; the supported characteristic uid's are
   101 		defined in plugincharacteristics.h; the supported operators are defined in ruleselector.h
   102 		@param aInterfaceScope		The Interface scope of this rule
   103 		@param aAlgorithmScope		The Algorithm scope of this rule
   104 		@param aCharacteristicValue	The value of the rule of this characteristic
   105 		@param aOperator			The operator of the rule
   106 		@param aIsOptional			Whether this rule is optional or mandatory
   107 		@return A pointer to a CSelectionRuleContent instance
   108 		*/
   109 		IMPORT_C static CSelectionRuleContent* NewL(TUid aInterfaceScope,
   110 													TUid aAlgorithmScope,
   111 													CCryptoParam* aCharacteristicValue,
   112 													TRuleOperator aOperator,
   113 													TBool aIsOptional);
   114 		/**
   115 		Destructor
   116 		*/
   117 		IMPORT_C ~CSelectionRuleContent();
   118 
   119 		/**
   120 		 * @internalComponent
   121 		 * 
   122 		 * Get the Interface Scope of this rule
   123 		 * @return the Interface Scope Uid of this rule
   124 		 **/
   125 		TUid GetInterfaceScope();
   126 
   127 		/**
   128 		 * @internalComponent
   129 		 * 
   130 		 * Get the Algorithm Scope of this rule
   131 		 * @return the Algorithm Scope Uid of this rule
   132 		 **/
   133 		TUid GetAlgorithmScope();
   134 
   135 		/**
   136 		 * @internalComponent
   137 		 * 
   138 		 * Get the Rule operator
   139 		 * @return The Rule operator
   140 		 **/
   141 		TInt GetOperator();
   142 
   143 		/**
   144 		 * @internalComponent
   145 		 * 
   146 		 * Get the value of the rule of this characteristic 
   147 		 * @return The value of the rule of this characteristic 
   148 		 **/
   149 		const CCryptoParam* GetCharacteristicValue();
   150 
   151 		/**
   152 		 * @internalComponent
   153 		 * 
   154 		 * returns whether the rule is optional
   155 		 * @return Whether the rule is optional
   156 		 **/
   157 		TBool IsOptionalRule();
   158 
   159 	private:
   160 		/**
   161 		Constructor
   162 		*/
   163 		CSelectionRuleContent(TUid aInterfaceScope,
   164 							TUid aAlgorithmScope,
   165 							CCryptoParam* aCharacteristicValue,
   166 							TRuleOperator aOperator,
   167 							TBool aIsOptional);
   168 
   169 		/**
   170 		The scopes of this rule 
   171 		*/
   172 		TUid iInterfaceScope;
   173 		TUid iAlgorithmScope;
   174 
   175 		/**
   176 		The value of the rule of this characteristic 
   177 		*/
   178 		const CCryptoParam* iCharacteristicValue;
   179 		
   180 		/**
   181 		The Operator of the Characteristic
   182 		*/
   183 		TRuleOperator iOperator;
   184 
   185 		/**
   186 		if the rule on this characteristic is optional
   187 		*/
   188 		TBool iIsOptional;
   189 		};
   190 
   191 	
   192 	/**
   193 	Definition of rule-based plugin selection rules
   194 	*/
   195 	NONSHARABLE_CLASS(CSelectionRules) : public CBase
   196 		{
   197 	public:
   198 		/**
   199 		create a Selection Rule instance which will hold the rules to filter the plugins
   200 		@return a pointer to a CSelectionRules instance
   201 		*/
   202 		IMPORT_C static CSelectionRules* NewL();
   203 		
   204 		/**
   205 		Destructor
   206 		*/
   207 		IMPORT_C ~CSelectionRules();
   208 
   209 		/**
   210 		Add a selection rule the this object
   211 		@param aSelectionRule	The rule to be added
   212 		*/
   213 		IMPORT_C void AddSelectionRuleL(CSelectionRuleContent* aSelectionRule);
   214 		
   215 		/**
   216 		 * @internalComponent
   217 		 *
   218 		 * Get the selection rules
   219 		 * @return The reference of the rules
   220 		 **/
   221 		RPointerArray<CSelectionRuleContent>& GetSelectionRules();
   222 
   223 	private:
   224 		/**
   225 		Constructor
   226 		*/
   227 		CSelectionRules();
   228 		
   229 		/**
   230 		a group of plugin rules
   231 		*/
   232 		RPointerArray<CSelectionRuleContent> iRules;
   233 		};
   234 	
   235 	/**
   236 	Selector apply the rule-based selection to find the plugin.
   237 	*/
   238 	NONSHARABLE_CLASS(CRuleSelector) : public CBase, public MPluginSelector
   239 		{
   240 	public:
   241 		/**
   242 		NewL create the ruled-based selector
   243 		@param aRules The Rules to select the plugins
   244 		@return a pointer to a CRuleSelector instance
   245 		*/
   246 		IMPORT_C static CRuleSelector* NewL(CSelectionRules* aRules);
   247 		IMPORT_C static CRuleSelector* NewLC(CSelectionRules* aRules);
   248 		
   249 		/**
   250 		Destructor
   251 		*/
   252 		IMPORT_C ~CRuleSelector();
   253 				
   254 		/**
   255 		 * @deprecated
   256 		 * 
   257 		 * virtual function from MPluginSelector
   258 		 */
   259 		virtual void CreateHashL(CHash*& aHash,
   260 											TUid aAlgorithmUid,
   261 											TUid aOperationMode,
   262 											const CKey* aKey,
   263 											const CCryptoParams* aAlgorithmParams);
   264 		
   265 		//virtual function from MPluginSelector						
   266 		virtual void CreateRandomL(CRandom*& aRandom,
   267 											TUid aAlgorithmUid,
   268 											const CCryptoParams* aAlgorithmParams);
   269 		
   270 		//virtual function from MPluginSelector
   271 		virtual void CreateSymmetricCipherL(CSymmetricCipher*& aCipher,
   272 											TUid aAlgorithmUid,
   273 											const CKey& aKey,
   274 											TUid aCryptoMode,
   275 											TUid aOperationMode,
   276 											TUid aPaddingMode,
   277 											const CCryptoParams* aAlgorithmParams);
   278 		
   279 		//virtual function from MPluginSelector
   280 		virtual void CreateAsymmetricCipherL(CAsymmetricCipher*& aCipher,
   281 											TUid aAlgorithmUid,
   282 											const CKey& aKey,
   283 											TUid aCryptoMode,
   284 											TUid aPaddingMode,									
   285 											const CCryptoParams* aAlgorithmParams);
   286 											
   287 		//virtual function from MPluginSelector
   288 		virtual void CreateSignerL(CSigner*& aSigner,
   289 											TUid aAlgorithmUid,
   290 											const CKey& aKey,
   291 											TUid aPaddingMode,
   292 											const CCryptoParams* aAlgorithmParams);
   293 		
   294 		//virtual function from MPluginSelector
   295 		virtual void CreateVerifierL(CVerifier*& aVerifier,
   296 											TUid aAlgorithmUid,
   297 											const CKey& aKey,
   298 											TUid aPaddingMode,
   299 											const CCryptoParams* aAlgorithmParams);
   300 
   301 		//virtual function from MPluginSelector
   302 		virtual void CreateKeyPairGeneratorL(CKeyPairGenerator*& aKeyPairGenerator,
   303 											TUid aKeyAlgorithmUid,
   304 											const CCryptoParams* aAlgorithmParams);
   305 
   306 		//virtual function from MPluginSelector
   307 		virtual void CreateKeyAgreementL(CKeyAgreement*& aKeyAgreement,
   308 											TUid aAlgorithmUid,
   309 											const CKey& aPrivateKey,
   310 											const CCryptoParams* aAlgorithmParams);
   311 
   312 		/**
   313 		 * @deprecated
   314 		 * 
   315 		 * virtual function from MPluginSelector
   316 		 */
   317 		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   318 										TUid aAlgorithmUid,
   319 										TUid aOperationMode,
   320 										const CKey* aKey,
   321 										const CCryptoParams* aAlgorithmParams);
   322 		
   323 		//virtual function from MPluginSelector
   324 		virtual void CreateAsyncRandomL(CAsyncRandom*& aRandom,
   325 										TUid aAlgorithmUid,
   326 										const CCryptoParams* aAlgorithmParams);
   327 
   328 		//virtual function from MPluginSelector
   329 		virtual void CreateAsyncSymmetricCipherL(CAsyncSymmetricCipher*& aCipher,
   330 										TUid aAlgorithmUid,
   331 										const CKey& aKey,
   332 										TUid aCryptoMode,
   333 										TUid aOperationMode,
   334 										TUid aPaddingMode,
   335 										const CCryptoParams* aAlgorithmParams);
   336 
   337 		//virtual function from MPluginSelector
   338 		virtual void CreateAsyncAsymmetricCipherL(CAsyncAsymmetricCipher*& aCipher,
   339 										TUid aAlgorithmUid,
   340 										const CKey& aKey,
   341 										TUid aCryptoMode,
   342 										TUid aPaddingMode,																						
   343 										const CCryptoParams* aAlgorithmParams);
   344 
   345 		//virtual function from MPluginSelector
   346 		virtual void CreateAsyncSignerL(CAsyncSigner*& aSigner,
   347 										TUid aAlgorithmUid,
   348 										const CKey& aKey,
   349 										TUid aPaddingMode,
   350 										const CCryptoParams* aAlgorithmParams);
   351 		
   352 		//virtual function from MPluginSelector
   353 		virtual void CreateAsyncVerifierL(CAsyncVerifier*& aVerifier,
   354 										TUid aAlgorithmUid,
   355 										const CKey& aKey,
   356 										TUid aPaddingMode,
   357 										const CCryptoParams* aAlgorithmParams);
   358 
   359 		//virtual function from MPluginSelector
   360 		virtual void CreateAsyncKeyPairGeneratorL(CAsyncKeyPairGenerator*& aKeyPairGenerator,
   361 										TUid aAlgorithmUid,
   362 										const CCryptoParams* aAlgorithmParams);
   363 
   364 		//virtual function from MPluginSelector
   365 		virtual void CreateAsyncKeyAgreementL(CAsyncKeyAgreement*& aKeyAgreement,
   366 										TUid aAlgorithmUid,
   367 										const CKey& aPrivateKey,
   368 										const CCryptoParams* aAlgorithmParams);			
   369 	
   370 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT	
   371 		
   372 		//virtual function from MPluginSelector	
   373 		virtual void CreateMacL(CMac*& aMac,
   374 								const TUid aAlgorithmUid,
   375 								const CKey& aKey,
   376 								const CCryptoParams* aAlgorithmParams);
   377 				
   378 		//virtual function from MPluginSelector
   379 		virtual void CreateAsyncMacL(CAsyncMac*& aMac,
   380 								const TUid aAlgorithmUid,
   381 								const CKey& aKey,
   382 								const CCryptoParams* aAlgorithmParams);
   383 		
   384 		//virtual function from MPluginSelector
   385 		virtual void CreateHashL(CHash*& aHash,
   386 								TUid aAlgorithmUid,
   387 								const CCryptoParams* aAlgorithmParams);
   388 
   389 		//virtual function from MPluginSelector
   390 		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   391 								TUid aAlgorithmUid,
   392 								const CCryptoParams* aAlgorithmParams);
   393 		
   394 #endif
   395 		
   396 		/** @internalComponent */
   397 		static TInt AscendCreatorName(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   398 
   399 		/** @internalComponent */
   400 		static TInt DescendCreatorName(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   401 		
   402 		/** @internalComponent */
   403 		static TInt AscendExtendedTDesC8L(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   404 		
   405 		/** @internalComponent */
   406 		static TInt DescendExtendedTDesC8L(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   407 
   408 		/** @internalComponent */
   409 		static TInt AscendMaxConcurrencySupported(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   410 		
   411 		/** @internalComponent */
   412 		static TInt DescendMaxConcurrencySupported(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   413 
   414 		/** @internalComponent */
   415 		static TInt AscendLatency(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   416 
   417 		/** @internalComponent */
   418 		static TInt DescendLatency(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   419 
   420 		/** @internalComponent */
   421 		static TInt AscendThroughput(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   422 
   423 		/** @internalComponent */
   424 		static TInt DescendThroughput(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   425 
   426 		/** @internalComponent */
   427 		static TInt AscendHashBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   428 
   429 		/** @internalComponent */
   430 		static TInt DescendHashBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   431 		
   432 		/** @internalComponent */
   433 		static TInt AscendSymmetricCipherBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   434 
   435 		/** @internalComponent */
   436 		static TInt DescendSymmetricCipherBlockSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   437 
   438 		/** @internalComponent */
   439 		static TInt AscendHashOutputSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   440 
   441 		/** @internalComponent */
   442 		static TInt DescendHashOutputSize(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   443 		
   444 		/** @internalComponent */
   445 		static TInt AscendRandomBlockingMode(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   446 
   447 		/** @internalComponent */
   448 		static TInt DescendRandomBlockingMode(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   449 
   450 		/** @internalComponent */
   451 		static TInt AscendSymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   452 
   453 		/** @internalComponent */
   454 		static TInt DescendSymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   455 
   456 		/** @internalComponent */
   457 		static TInt AscendAsymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   458 
   459 		/** @internalComponent */
   460 		static TInt DescendAsymmetricCipherKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   461 
   462 		/** @internalComponent */
   463 		static TInt AscendAsymmetricSignatureKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   464 
   465 		/** @internalComponent */
   466 		static TInt DescendAsymmetricSignatureKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   467 
   468 		/** @internalComponent */
   469 		static TInt AscendSymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   470 
   471 		/** @internalComponent */
   472 		static TInt DescendSymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   473 
   474 		/** @internalComponent */
   475 		static TInt AscendAsymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   476 
   477 		/** @internalComponent */
   478 		static TInt DescendAsymmetricCipherKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   479 
   480 		/** @internalComponent */
   481 		static TInt AscendAsymmetricSignatureKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   482 
   483 		/** @internalComponent */
   484 		static TInt DescendAsymmetricSignatureKeySupport(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   485 
   486 		/** @internalComponent */
   487 		static TInt AscendAsymmetricKeypairGeneratorKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   488 
   489 		/** @internalComponent */
   490 		static TInt DescendAsymmetricKeypairGeneratorKeyLength(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   491 
   492 		/** @internalComponent */
   493 		static TInt AscendExtendedCharacteristicL(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   494 		
   495 		/** @internalComponent */
   496 		static TInt DescendExtendedCharacteristicL(const CRulesCharacteristicsAndPluginName& aLeft, const CRulesCharacteristicsAndPluginName& aRight);
   497 	
   498 	private:
   499 
   500 		/**
   501 		Constructor
   502 		@param aRules the Rules to select the plugins
   503 		*/
   504 		CRuleSelector();
   505 
   506 		/**
   507 		Second Phase Constructor
   508 		*/
   509 		void ConstructL(CSelectionRules* aRules);
   510 
   511 		void PerformFilterL(CSelectionRules* aRules);
   512 
   513 		void PerformAlgorithmFilterL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   514 									CSelectionRuleContent* aRules, TInt& aLastPreference);
   515 
   516 		TBool FilterCommonCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   517 											CSelectionRuleContent* aRules, TInt& aLastPreference);
   518 
   519 		TBool FilterNonCommonCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   520 												CSelectionRuleContent* aRules, TInt& aLastPreference);
   521 
   522 		TBool FilterExtendedCharacteristicsL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   523 												CSelectionRuleContent* aRules, TInt& aLastPreference);
   524 
   525 		void FilterTInt32L(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   526 							CSelectionRuleContent* aRules, TInt& aLastPreference, TInt32 aCharValue);
   527 		
   528 		void FilterMultiTInt32L(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristicsDLL,
   529 								CSelectionRuleContent* aRules, TInt& aLastPreference,
   530 								TBool aSupport);
   531 
   532 		void FilterCreatorNameL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   533 								CSelectionRuleContent* aRules, TInt& aLastPreference);
   534 
   535 		void FilterExtendedTDesC8L(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   536 									CSelectionRuleContent* aRules, TInt& aLastPreference, const TDesC8& aCharValue);
   537 										
   538 		void FilterTBoolL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   539 							CSelectionRuleContent* aRules, TInt& aLastPreference, TBool aCharValue);
   540 
   541 		void FilterTIntL(TInt32 aInterfaceUid, RPointerArray<CRulesCharacteristicsAndPluginName>& aCharacteristicsDLL,
   542 							CSelectionRuleContent* aRules, TInt& aLastPreference, TInt aCharValue);
   543 
   544 		void TryAddToOptionalCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   545 										CSelectionRuleContent* aRules);
   546 
   547 		void AddToCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics,
   548 							TInt& aLastPreference);
   549 		
   550 		void AddOptionalToCharListL(TInt32 aInterfaceUid, CRulesCharacteristicsAndPluginName& aCharacteristics);
   551 		
   552 		void ConstructMapAL();
   553 
   554 		void SetSearchRecord(TUid aInterfaceUid, TInt aValue);
   555 		
   556 		/**
   557 		Loads the crypto plugins
   558 		*/
   559 		void LoadPluginsL();
   560 
   561 		TInt FindPlugin(TUid aInterfaceUid, TUid aAlgorithmUid, TUid& aImplementationId, TFileName& aDllName);
   562 
   563 		/**
   564 		The selection rules to filter the plugins
   565 		*/
   566 		CSelectionRules* iSelectionRules;
   567 
   568 		/**
   569 		Maps of the interface UID and the pointer of algorithm's characteristic array
   570 		They are used alternatively to filter from one array to the other
   571 		The final array will be set to iActiveInterfaceCharacteristics_Map for plugin lookup
   572 		*/
   573 		RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*> iSelectedInterfaceCharacteristics_MapA;
   574 		RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*> iSelectedInterfaceCharacteristics_MapB;
   575 		
   576 		/**
   577 		Pointer of the active map of the interface UID and the characteristic list
   578 		*/
   579 		const RHashMap<TInt32, RPointerArray<CRulesCharacteristicsAndPluginName>*>* iActiveInterfaceCharacteristics_Map;
   580 		
   581 		/**
   582 		Records the next index to try
   583 		*/
   584 		RHashMap<TInt32, TInt> iNextTryCharacteristicsIndex;
   585 		
   586 		/**
   587 		To indicate whether to use iSelectedInterfaceCharacteristics_MapA 
   588 		or iSelectedInterfaceCharacteristics_MapA to filter
   589 		*/
   590 		TBool iUseMapAToFilter;
   591 		
   592 		/**
   593 		This is use to indicate whether to alternate the maps for next rule filtering or not
   594 		*/
   595 		TBool iToggleUseMap;
   596 		
   597 		/**
   598 		The plugin DLL list, which holds all the plugin DLLs
   599 		*/
   600 		RArray<RLibrary> iPluginDllList;
   601 		};
   602 	}
   603 
   604 #endif //__CRYPTOAPI_RULESELECTOR_H__