crypto/weakcryptospi/source/random/randomshim.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Sat, 20 Feb 2010 00:36:18 +0200
branchRCL_3
changeset 41 9b5a3a9fddf8
parent 19 cd501b96611d
permissions -rw-r--r--
Revision: 201007 Kit: 201007

/*
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
* random shim class definition
*
*/


/**
 @file
 @internalComponent
 @released
*/

#ifndef __RANDOMSHIM_H__
#define __RANDOMSHIM_H__

#include <e32def.h>
#include <random.h>
#include <cryptospi/cryptorandomapi.h>

//
// CRandom shim class
//
NONSHARABLE_CLASS(CRandomShim) : public CBase
	{
public:
	static CRandomShim* NewL();
	static CRandomShim* NewLC();
	~CRandomShim();
	virtual void GenerateBytesL(TDes8& aDest);
	
private:
	CRandomShim();
	CRandomShim(const CRandomShim&);
	CRandomShim& operator=(const CRandomShim&);	
	void ConstructL();

private:
	CryptoSpi::CRandom* iRandomImpl;
	};

class TRandomShim
	{
public:
	static void Random(TDes8& aDestination);
	static void RandomL(TDes8& aDestination);
	static void SecureRandomL(TDes8& aDestination);
	};

#endif // __RANDOMSHIM_H__