crypto/weakcryptospi/inc/spi/pluginselectorbase.h
changeset 33 cf642210ecb7
parent 8 35751d3474b7
equal deleted inserted replaced
29:ece3df019add 33:cf642210ecb7
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 /**
    20 /**
    21  @file
    21  @file
    22  @publishedPartner
    22  @publishedAll
    23  @released
    23  @released
    24 */
    24 */
    25 
    25 
    26 #ifndef __CRYPTOAPI_PLUGINSELECTORBASE_H__
    26 #ifndef __CRYPTOAPI_PLUGINSELECTORBASE_H__
    27 #define __CRYPTOAPI_PLUGINSELECTORBASE_H__
    27 #define __CRYPTOAPI_PLUGINSELECTORBASE_H__
    76 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1
    76 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1
    77 		 * @param 	aOperationMode The operation mode of the hash e.g. Hash mode, Hmac mode
    77 		 * @param 	aOperationMode The operation mode of the hash e.g. Hash mode, Hmac mode
    78 		 * @param 	aKey The key for Hmac mode, which should be NULL in Hash mode
    78 		 * @param 	aKey The key for Hmac mode, which should be NULL in Hash mode
    79 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
    79 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
    80 		 * 			algorithm. This is for extendibility and will normally be null.
    80 		 * 			algorithm. This is for extendibility and will normally be null.
       
    81 		 * @leave 	KErrNone if successful; otherwise, a system wide error code.
    81 		 */
    82 		 */
    82 		virtual void CreateHashL(CHash*& aHash,
    83 		virtual void CreateHashL(CHash*& aHash,
    83 								TUid aAlgorithmUid,
    84 								TUid aAlgorithmUid,
    84 								TUid aOperationMode,
    85 								TUid aOperationMode,
    85 								const CKey* aKey,
    86 								const CKey* aKey,
    89 		Creates a new instance of a Random object.
    90 		Creates a new instance of a Random object.
    90 
    91 
    91 		@param aRandom A reference to a pointer that should be set to point to the new CRandom object.
    92 		@param aRandom A reference to a pointer that should be set to point to the new CRandom object.
    92 		@param aAlgorithmUid The algorithm to use
    93 		@param aAlgorithmUid The algorithm to use
    93 		@param aAlgorithmParams Parameters that are specific this algorithm.
    94 		@param aAlgorithmParams Parameters that are specific this algorithm.
       
    95 	    @leave KErrNone if successful; otherwise, a system wide error code.
    94 		*/		
    96 		*/		
    95 		virtual void CreateRandomL(CRandom*& aRandom,
    97 		virtual void CreateRandomL(CRandom*& aRandom,
    96 									TUid aAlgorithmUid,
    98 									TUid aAlgorithmUid,
    97 									const CCryptoParams* aAlgorithmParams) = 0;
    99 									const CCryptoParams* aAlgorithmParams) = 0;
    98 		
   100 		
   104 		@param aKey The encryption/decryption key.
   106 		@param aKey The encryption/decryption key.
   105 		@param aCryptoMode The Symmetric cipher mode.
   107 		@param aCryptoMode The Symmetric cipher mode.
   106 		@param aOperationMode The Symmetric cipher operation mode.
   108 		@param aOperationMode The Symmetric cipher operation mode.
   107 		@param aPaddingMode The Symmetric cipher padding mode.
   109 		@param aPaddingMode The Symmetric cipher padding mode.
   108 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   110 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   111 		@leave	KErrNone if successful; otherwise, a system wide error code.
   109 		*/
   112 		*/
   110 		virtual void CreateSymmetricCipherL(CSymmetricCipher*& aCipher,
   113 		virtual void CreateSymmetricCipherL(CSymmetricCipher*& aCipher,
   111 											TUid aAlgorithmUid,
   114 											TUid aAlgorithmUid,
   112 											const CKey& aKey,
   115 											const CKey& aKey,
   113 											TUid aCryptoMode,
   116 											TUid aCryptoMode,
   122 		@param aAlgorithmUid The asymmetric cipher algorithm to use (e.g. KRsaCipherUid)
   125 		@param aAlgorithmUid The asymmetric cipher algorithm to use (e.g. KRsaCipherUid)
   123 		@param aKey The encryption/decryption key.
   126 		@param aKey The encryption/decryption key.
   124 		@param aCryptoMode whether to encrypt or decrypt
   127 		@param aCryptoMode whether to encrypt or decrypt
   125 		@param aPaddingMode The padding mode to use
   128 		@param aPaddingMode The padding mode to use
   126 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   129 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   130 		@leave	KErrNone if successful; otherwise, a system wide error code.
   127 		*/
   131 		*/
   128 		virtual void CreateAsymmetricCipherL(CAsymmetricCipher*& aCipher,
   132 		virtual void CreateAsymmetricCipherL(CAsymmetricCipher*& aCipher,
   129 											TUid aAlgorithmUid,
   133 											TUid aAlgorithmUid,
   130 											const CKey& aKey,
   134 											const CKey& aKey,
   131 											TUid aCryptoMode,
   135 											TUid aCryptoMode,
   138 		@param aSigner A reference to a pointer that should be set to point to the new signer object.
   142 		@param aSigner A reference to a pointer that should be set to point to the new signer object.
   139 		@param aAlgorithmUid The algorithm to use.
   143 		@param aAlgorithmUid The algorithm to use.
   140 		@param aKey The signing key.
   144 		@param aKey The signing key.
   141 		@param aPaddingMode The padding mode of the signer.
   145 		@param aPaddingMode The padding mode of the signer.
   142 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   146 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   147 		@leave	KErrNone if successful; otherwise, a system wide error code.
   143 		*/
   148 		*/
   144 		virtual void CreateSignerL(CSigner*& aSigner,
   149 		virtual void CreateSignerL(CSigner*& aSigner,
   145 									TUid aAlgorithmUid,
   150 									TUid aAlgorithmUid,
   146 									const CKey& aKey,
   151 									const CKey& aKey,
   147 									TUid aPaddingMode,
   152 									TUid aPaddingMode,
   153 		@param aVerifier A reference to a pointer that should be set to point to the new verifier object.
   158 		@param aVerifier A reference to a pointer that should be set to point to the new verifier object.
   154 		@param aAlgorithmUid The algorithm to use
   159 		@param aAlgorithmUid The algorithm to use
   155 		@param aKey The key to verify the signature with.
   160 		@param aKey The key to verify the signature with.
   156 		@param aPaddingMode The padding mode of the signer.
   161 		@param aPaddingMode The padding mode of the signer.
   157 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   162 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   163 		@leave	KErrNone if successful; otherwise, a system wide error code.
   158 		*/
   164 		*/
   159 		virtual void CreateVerifierL(CVerifier*& aVerifier,
   165 		virtual void CreateVerifierL(CVerifier*& aVerifier,
   160 									TUid aAlgorithmUid,
   166 									TUid aAlgorithmUid,
   161 									const CKey& aKey,
   167 									const CKey& aKey,
   162 									TUid aPaddingMode,
   168 									TUid aPaddingMode,
   166 		Creates a new instance of a key pair generator.
   172 		Creates a new instance of a key pair generator.
   167 
   173 
   168 		@param aKeyPairGenerator A reference to a pointer that should be set to point to the new asymmetric key pair generator object.
   174 		@param aKeyPairGenerator A reference to a pointer that should be set to point to the new asymmetric key pair generator object.
   169 		@param aKeyAlgorithmUid	The algorithm UID
   175 		@param aKeyAlgorithmUid	The algorithm UID
   170 		@param aAlgorithmParams	The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   176 		@param aAlgorithmParams	The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   177 		@leave	KErrNone if successful; otherwise, a system wide error code.
   171 		*/
   178 		*/
   172 		virtual void CreateKeyPairGeneratorL(CKeyPairGenerator*& aKeyPairGenerator,
   179 		virtual void CreateKeyPairGeneratorL(CKeyPairGenerator*& aKeyPairGenerator,
   173 											TUid aKeyAlgorithmUid,
   180 											TUid aKeyAlgorithmUid,
   174 											const CCryptoParams* aAlgorithmParams) = 0;
   181 											const CCryptoParams* aAlgorithmParams) = 0;
   175 
   182 
   179 
   186 
   180 		@param aKeyAgreement A reference to a pointer that should be set to point to the new key agreement object.
   187 		@param aKeyAgreement A reference to a pointer that should be set to point to the new key agreement object.
   181 		@param aAlgorithmUid The algorithm to use
   188 		@param aAlgorithmUid The algorithm to use
   182 		@param aPrivateKey The private key to combine with the other parties public key during the agreement.
   189 		@param aPrivateKey The private key to combine with the other parties public key during the agreement.
   183 		@param aAlgorithmParams The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   190 		@param aAlgorithmParams The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   191 		@leave	KErrNone if successful; otherwise, a system wide error code.
   184 		*/
   192 		*/
   185 		virtual void CreateKeyAgreementL(CKeyAgreement*& aKeyAgreement,
   193 		virtual void CreateKeyAgreementL(CKeyAgreement*& aKeyAgreement,
   186 										TUid aAlgorithmUid,
   194 										TUid aAlgorithmUid,
   187 										const CKey& aPrivateKey,
   195 										const CKey& aPrivateKey,
   188 										const CCryptoParams* aAlgorithmParams) = 0;
   196 										const CCryptoParams* aAlgorithmParams) = 0;
   196 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1
   204 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1
   197 		 * @param 	aOperationMode The operation mode of the hash e.g. Hash mode, Hmac mode
   205 		 * @param 	aOperationMode The operation mode of the hash e.g. Hash mode, Hmac mode
   198 		 * @param 	aKey The key for Hmac mode, which should be NULL in Hash mode
   206 		 * @param 	aKey The key for Hmac mode, which should be NULL in Hash mode
   199 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   207 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   200 		 * 			algorithm. This is for extendibility and will normally be null.
   208 		 * 			algorithm. This is for extendibility and will normally be null.
       
   209 		 * @leave	KErrNone if successful; otherwise, a system wide error code.
   201 		 */										
   210 		 */										
   202 		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   211 		virtual void CreateAsyncHashL(CAsyncHash*& aHash,
   203 										TUid aAlgorithmUid,
   212 										TUid aAlgorithmUid,
   204 										TUid aOperationMode,
   213 										TUid aOperationMode,
   205 										const CKey* aKey,
   214 										const CKey* aKey,
   208 		Creates a new instance of a asynchronous random object.
   217 		Creates a new instance of a asynchronous random object.
   209 
   218 
   210 		@param aRandom A reference to a pointer that should be set to point to the new CRandom object.
   219 		@param aRandom A reference to a pointer that should be set to point to the new CRandom object.
   211 		@param aAlgorithmUid The algorithm to use
   220 		@param aAlgorithmUid The algorithm to use
   212 		@param aAlgorithmParams Parameters that are specific this algorithm.
   221 		@param aAlgorithmParams Parameters that are specific this algorithm.
       
   222 		@leave	KErrNone if successful; otherwise, a system wide error code.
   213 		*/
   223 		*/
   214 		virtual void CreateAsyncRandomL(CAsyncRandom*& aRandom,
   224 		virtual void CreateAsyncRandomL(CAsyncRandom*& aRandom,
   215 										TUid aAlgorithmUid,
   225 										TUid aAlgorithmUid,
   216 										const CCryptoParams* aAlgorithmParams) = 0;
   226 										const CCryptoParams* aAlgorithmParams) = 0;
   217 		/**
   227 		/**
   222 		@param aKey The encryption/decryption key.
   232 		@param aKey The encryption/decryption key.
   223 		@param aCryptoMode The Symmetric cipher mode.
   233 		@param aCryptoMode The Symmetric cipher mode.
   224 		@param aOperationMode The Symmetric cipher operation mode.
   234 		@param aOperationMode The Symmetric cipher operation mode.
   225 		@param aPaddingMode The Symmetric cipher padding mode.
   235 		@param aPaddingMode The Symmetric cipher padding mode.
   226 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   236 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   237 		@leave	KErrNone if successful; otherwise, a system wide error code.
   227 		*/
   238 		*/
   228 		virtual void CreateAsyncSymmetricCipherL(CAsyncSymmetricCipher*& aCipher,
   239 		virtual void CreateAsyncSymmetricCipherL(CAsyncSymmetricCipher*& aCipher,
   229 										TUid aAlgorithmUid,
   240 										TUid aAlgorithmUid,
   230 										const CKey& aKey,
   241 										const CKey& aKey,
   231 										TUid aCryptoMode,
   242 										TUid aCryptoMode,
   240 		@param aAlgorithmUid The asymmetric cipher algorithm to use (e.g. KRsaCipherUid)
   251 		@param aAlgorithmUid The asymmetric cipher algorithm to use (e.g. KRsaCipherUid)
   241 		@param aKey The encryption/decryption key.
   252 		@param aKey The encryption/decryption key.
   242 		@param aCryptoMode whether to encrypt or decrypt
   253 		@param aCryptoMode whether to encrypt or decrypt
   243 		@param aPaddingMode The padding mode to use
   254 		@param aPaddingMode The padding mode to use
   244 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   255 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   256 		@leave	KErrNone if successful; otherwise, a system wide error code.
   245 		*/
   257 		*/
   246 		virtual void CreateAsyncAsymmetricCipherL(CAsyncAsymmetricCipher*& aCipher,
   258 		virtual void CreateAsyncAsymmetricCipherL(CAsyncAsymmetricCipher*& aCipher,
   247 										TUid aAlgorithmUid,
   259 										TUid aAlgorithmUid,
   248 										const CKey& aKey,
   260 										const CKey& aKey,
   249 										TUid aCryptoMode,
   261 										TUid aCryptoMode,
   255 		@param aSigner A reference to a pointer that should be set to point to the new signer object.
   267 		@param aSigner A reference to a pointer that should be set to point to the new signer object.
   256 		@param aAlgorithmUid The algorithm to use.
   268 		@param aAlgorithmUid The algorithm to use.
   257 		@param aKey The signing key.
   269 		@param aKey The signing key.
   258 		@param aPaddingMode The padding mode of the signer.
   270 		@param aPaddingMode The padding mode of the signer.
   259 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   271 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   272 		@leave	KErrNone if successful; otherwise, a system wide error code.
   260 		*/
   273 		*/
   261 		virtual void CreateAsyncSignerL(CAsyncSigner*& aSigner,
   274 		virtual void CreateAsyncSignerL(CAsyncSigner*& aSigner,
   262 										TUid aAlgorithmUid,
   275 										TUid aAlgorithmUid,
   263 										const CKey& aKey,
   276 										const CKey& aKey,
   264 										TUid aPaddingMode,
   277 										TUid aPaddingMode,
   269 		@param aVerifier A reference to a pointer that should be set to point to the new verifier object.
   282 		@param aVerifier A reference to a pointer that should be set to point to the new verifier object.
   270 		@param aAlgorithmUid The algorithm to use
   283 		@param aAlgorithmUid The algorithm to use
   271 		@param aKey The key to verify the signature with.
   284 		@param aKey The key to verify the signature with.
   272 		@param aPaddingMode The padding mode of the signer.
   285 		@param aPaddingMode The padding mode of the signer.
   273 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   286 		@param aAlgorithmParams Parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   287 		@leave	KErrNone if successful; otherwise, a system wide error code.
   274 		*/		
   288 		*/		
   275 		virtual void CreateAsyncVerifierL(CAsyncVerifier*& aVerifier,
   289 		virtual void CreateAsyncVerifierL(CAsyncVerifier*& aVerifier,
   276 										TUid aAlgorithmUid,
   290 										TUid aAlgorithmUid,
   277 										const CKey& aKey,
   291 										const CKey& aKey,
   278 										TUid aPaddingMode,
   292 										TUid aPaddingMode,
   282 		Creates a new instance of a asynchronous key pair generator.
   296 		Creates a new instance of a asynchronous key pair generator.
   283 
   297 
   284 		@param aKeyPairGenerator A reference to a pointer that should be set to point to the new asymmetric key pair generator object.
   298 		@param aKeyPairGenerator A reference to a pointer that should be set to point to the new asymmetric key pair generator object.
   285 		@param aKeyAlgorithmUid	The algorithm UID
   299 		@param aKeyAlgorithmUid	The algorithm UID
   286 		@param aAlgorithmParams	The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   300 		@param aAlgorithmParams	The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   301 		@leave	KErrNone if successful; otherwise, a system wide error code.
   287 		*/
   302 		*/
   288 		virtual void CreateAsyncKeyPairGeneratorL(CAsyncKeyPairGenerator*& aKeyPairGenerator,
   303 		virtual void CreateAsyncKeyPairGeneratorL(CAsyncKeyPairGenerator*& aKeyPairGenerator,
   289 										TUid aAlgorithmUid,
   304 										TUid aAlgorithmUid,
   290 										const CCryptoParams* aAlgorithmParams) = 0;
   305 										const CCryptoParams* aAlgorithmParams) = 0;
   291 
   306 
   294 
   309 
   295 		@param aKeyAgreement A reference to a pointer that should be set to point to the new key agreement object.
   310 		@param aKeyAgreement A reference to a pointer that should be set to point to the new key agreement object.
   296 		@param aAlgorithmUid The algorithm to use
   311 		@param aAlgorithmUid The algorithm to use
   297 		@param aPrivateKey The private key to combine with the other parties public key during the agreement.
   312 		@param aPrivateKey The private key to combine with the other parties public key during the agreement.
   298 		@param aAlgorithmParams The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
   313 		@param aAlgorithmParams The parameters that are specific to a particular algorithm. This is for extendibility and will normally be null.
       
   314 		@leave	KErrNone if successful; otherwise, a system wide error code.
   299 		*/
   315 		*/
   300 		virtual void CreateAsyncKeyAgreementL(CAsyncKeyAgreement*& aKeyAgreement,
   316 		virtual void CreateAsyncKeyAgreementL(CAsyncKeyAgreement*& aKeyAgreement,
   301 										TUid aAlgorithmUid,
   317 										TUid aAlgorithmUid,
   302 										const CKey& aPrivateKey,
   318 										const CKey& aPrivateKey,
   303 										const CCryptoParams* aAlgorithmParams) = 0;		
   319 										const CCryptoParams* aAlgorithmParams) = 0;		
   343 		 * 
   359 		 * 
   344 		 * @param 	aHash The pointer to CHash
   360 		 * @param 	aHash The pointer to CHash
   345 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1, MD4
   361 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1, MD4
   346 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   362 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   347 		 * 			algorithm. This is for extendibility and will normally be null.
   363 		 * 			algorithm. This is for extendibility and will normally be null.
   348 		 * @return 	KErrNone if successful; otherwise, a system wide error code.
   364 		 * @leave 	KErrNone if successful; otherwise, a system wide error code.
   349 		 */
   365 		 */
   350 		virtual void CreateHashL(CHash*& aHash,
   366 		virtual void CreateHashL(CHash*& aHash,
   351 								TUid aAlgorithmUid,
   367 								TUid aAlgorithmUid,
   352 								const CCryptoParams* aAlgorithmParams) = 0;
   368 								const CCryptoParams* aAlgorithmParams) = 0;
   353 
   369 
   356 		 * 	
   372 		 * 	
   357 		 * @param 	aAsyncHash The pointer to CAsyncHash
   373 		 * @param 	aAsyncHash The pointer to CAsyncHash
   358 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1, MD4
   374 		 * @param 	aAlgorithmUid The specific hash algorithm e.g. MD2, SHA1, MD4
   359 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   375 		 * @param 	aAlgorithmParams The parameters that are specific to a particular 
   360 		 * 			algorithm. This is for extendibility and will normally be null.
   376 		 * 			algorithm. This is for extendibility and will normally be null.
   361 		 * @return 	KErrNone if successful; otherwise, a system wide error code.
   377 		 * @leave 	KErrNone if successful; otherwise, a system wide error code.
   362 		 */
   378 		 */
   363 		virtual void CreateAsyncHashL(CAsyncHash*& aAsyncHash, 
   379 		virtual void CreateAsyncHashL(CAsyncHash*& aAsyncHash, 
   364 								TUid aAlgorithmUid,
   380 								TUid aAlgorithmUid,
   365 								const CCryptoParams* aAlgorithmParams) = 0;
   381 								const CCryptoParams* aAlgorithmParams) = 0;
   366 		
   382