os/security/cryptoplugins/cryptospiplugins/source/softwarecrypto/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) 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 * Software random implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @internalComponent
    23  @released
    24 */
    25 
    26 #ifndef __CRYPTOAPI_RANDOMIMPL_H__
    27 #define __CRYPTOAPI_RANDOMIMPL_H__
    28 
    29 #include <cryptospi/cryptoplugin.h>
    30 #include <cryptospi/randomplugin.h>
    31 
    32 namespace SoftwareCrypto
    33 	{
    34 	using namespace CryptoSpi;
    35 	
    36 	NONSHARABLE_CLASS(CRandomImpl): public CBase, public MRandom
    37 		{
    38 	public:
    39 		// NewL & NewLC
    40 		static CRandomImpl* NewL();
    41 		static CRandomImpl* NewLC();
    42 		
    43 		// From MPlugin
    44 		void Reset();
    45 		void Close();
    46 		void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
    47 		const CExtendedCharacteristics* GetExtendedCharacteristicsL();
    48 		TAny* GetExtension(TUid aExtensionId);
    49 		TUid ImplementationUid() const;
    50 		
    51 		// From MRandom
    52 		void GenerateRandomBytesL(TDes8& aDest);
    53 		
    54 		static CExtendedCharacteristics* CreateExtendedCharacteristicsL();
    55 		
    56 	private:
    57 		//Constructor
    58 		CRandomImpl();
    59 		
    60 		//Destructor
    61 		~CRandomImpl();
    62 		
    63 	private:
    64 		TUid iImplementationUid;
    65 		};
    66 	}
    67 
    68 #endif // __CRYPTOAPI_RANDOMIMPL_H__