crypto/weakcryptospi/source/random/randomshim.h
changeset 19 cd501b96611d
child 41 9b5a3a9fddf8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/crypto/weakcryptospi/source/random/randomshim.h	Fri Nov 06 13:21:00 2009 +0200
@@ -0,0 +1,61 @@
+/*
+* 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);
+	};
+
+#endif // __RANDOMSHIM_H__