author | hgs |
Wed, 06 Oct 2010 11:09:48 +0530 | |
changeset 102 | deec7e509f66 |
parent 55 | 581b7c2ef978 |
permissions | -rw-r--r-- |
17 | 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&); |
|
55
581b7c2ef978
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
47 |
CRandomShim& operator=(const CRandomShim&); |
17 | 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); |
|
55
581b7c2ef978
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
17
diff
changeset
|
59 |
static void SecureRandomL(TDes8& aDestination); |
17 | 60 |
}; |
61 |
||
62 |
#endif // __RANDOMSHIM_H__ |