os/security/crypto/weakcryptospi/source/spi/cryptospiutil.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 * CryptoSpi Utility Functionality definition
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @internalComponent
    23  @released
    24 */
    25 
    26 #ifndef __CRYPTOSPIUTIL_H__
    27 #define __CRYPTOSPIUTIL_H__
    28 
    29 #include <cryptospi/cryptocharacteristics.h>
    30 #include <cryptospi/ruleselector.h>
    31 
    32 namespace CryptoSpi
    33 	{
    34 	class CryptoSpiUtil
    35 		{
    36 	public:
    37 		
    38 		/**
    39 		Run the cryptospi setup executable to publish the characteristics
    40 		@return KErrNone if successful; otherwise, a system wide error code.
    41 		*/
    42 		static TInt RunCryptoSpiPropertySetupExe();
    43 		
    44 		/**
    45 		Retrieve characteristics and Dll list for an interface
    46 		@param aInterface the interface Uid
    47 		*/
    48 		static void RetrieveCharacteristicsL(TInt32 aInterface, RPointerArray<CCharacteristicsAndPluginName>& aList);
    49 
    50 		/**
    51 		Retrieve characteristics and Dll list for an interface
    52 		@param aInterface the interface Uid
    53 		*/
    54 		static void RetrieveCharacteristicsL(TInt32 aInterface, RPointerArray<CRulesCharacteristicsAndPluginName>& aList);
    55 
    56 		/**
    57 		Get the plugin dll name from the given Dll index
    58 		@param aDllIndex dll index
    59 		@param aName the plugin file name
    60 		@return KErrNone if successful; otherwise, a system wide error code.
    61 		*/
    62 		static TInt DllIndexToName(TInt aDllIndex, TFileName& aName);
    63 		
    64 		/**
    65 		Load the given name plugin Dll, and leaves the plugin handle on the cleanup stack
    66 		@param aLib the library handle of the plugin dll, which is put on the cleanup stack.
    67 		@param aFileName the plugin dll file name
    68 		*/
    69 		static void LoadPluginDllLC(RLibrary& aLib, TFileName& aFileName);
    70 		
    71 		/**
    72 		Create the characteristics for a crypto interface
    73 		@param aInterface the crypto interface
    74 		@return the pointer to characteristic
    75 		*/
    76 		static CCharacteristics* CreateCharacteristicsL(TInt32 aInterface);
    77 		
    78 	private:
    79 		/**
    80 		Retrieve the characteristics to the given buffer
    81 		@param aInterface the crypto interface
    82 		@param aStream the steam to read from
    83 		@param aBuf the buffer which holds the characteristic
    84 		@param aCount the count of the characteristics.
    85 		*/	
    86 		static TInt RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount);
    87 		};
    88 	}
    89 
    90 #endif //__CRYPTOSPIUTIL_H__
    91 
    92