os/security/cryptoplugins/cryptospiplugins/test/h4drv/crypto_h4_plugin/randomimpl.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2007-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 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @internalComponent
    22  @released
    23 */
    24 #ifndef __CRYPTOAPI_RANDOMIMPL_H__
    25 #define __CRYPTOAPI_RANDOMIMPL_H__
    26 
    27 #include <cryptospi/cryptoplugin.h>
    28 #include <cryptospi/randomplugin.h>
    29 #include "cryptodriver.h"
    30 
    31 #ifdef __MARM__
    32 #define __NOTSHARED __declspec(notshared)
    33 #else
    34 #define __NOTSHARED
    35 #endif
    36 
    37 namespace HwCrypto
    38 	{
    39 	using namespace CryptoSpi;
    40 	
    41 	//	NONSHARABLE_CLASS(CRandomImpl): public CBase, public MRandom
    42 	class __NOTSHARED CRandomImpl : public CBase, public MRandom
    43 		{
    44 	public:
    45 		// NewL & NewLC
    46 		static CRandomImpl* NewL();
    47 		static CRandomImpl* NewLC();
    48 		
    49 		// From MPlugin
    50 		void Reset();
    51 		void Close();
    52 		void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
    53 		const CExtendedCharacteristics* GetExtendedCharacteristicsL();
    54 		static CExtendedCharacteristics* StaticGetExtendedCharacteristicsL();
    55 
    56 
    57 		TAny* GetExtension(TUid aExtensionId);
    58 		TUid ImplementationUid() const;
    59 		
    60 		// From MRandom
    61 		void GenerateRandomBytesL(TDes8& aDest);
    62 
    63 	private:
    64 		//Constructor
    65 		CRandomImpl();
    66 		
    67 		//Destructor
    68 		~CRandomImpl();
    69 		
    70 	private:
    71 		void ConstructL();
    72 
    73 		TUid iImplementationUid;
    74 		RCryptoDriver iCryptoDriver;
    75 		};
    76 	}
    77 
    78 #endif // __CRYPTOAPI_RANDOMIMPL_H__