os/security/crypto/weakcryptospi/source/random/randomshim.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 * random shim class definition
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @internalComponent
    23  @released
    24 */
    25 
    26 #ifndef __RANDOMSHIM_H__
    27 #define __RANDOMSHIM_H__
    28 
    29 #include <e32def.h>
    30 #include <random.h>
    31 #include <cryptospi/cryptorandomapi.h>
    32 
    33 //
    34 // CRandom shim class
    35 //
    36 NONSHARABLE_CLASS(CRandomShim) : public CBase
    37 	{
    38 public:
    39 	static CRandomShim* NewL();
    40 	static CRandomShim* NewLC();
    41 	~CRandomShim();
    42 	virtual void GenerateBytesL(TDes8& aDest);
    43 	
    44 private:
    45 	CRandomShim();
    46 	CRandomShim(const CRandomShim&);
    47 	CRandomShim& operator=(const CRandomShim&);	
    48 	void ConstructL();
    49 
    50 private:
    51 	CryptoSpi::CRandom* iRandomImpl;
    52 	};
    53 
    54 class TRandomShim
    55 	{
    56 public:
    57 	static void Random(TDes8& aDestination);
    58 	static void RandomL(TDes8& aDestination);
    59 	static void SecureRandomL(TDes8& aDestination);
    60 	};
    61 
    62 #endif // __RANDOMSHIM_H__