|
1 /* |
|
2 * Copyright (c) 2006 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 "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: Implementation of DevTokenDHParams |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "DevTokenDataTypes.h" |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CDevTokenDHParams::~CDevTokenDHParams() |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 EXPORT_C CDevTokenDHParams::~CDevTokenDHParams() |
|
30 { |
|
31 iN.Close(); |
|
32 iG.Close(); |
|
33 } |
|
34 |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // CDevTokenDHParams::CDevTokenDHParams(RInteger aN, RInteger aG) |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 EXPORT_C CDevTokenDHParams::CDevTokenDHParams(RInteger aN, RInteger aG) |
|
41 : iN(aN), iG(aG) |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // CDevTokenDHParams::NewL(const TInteger& aN, const TInteger& aG) |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 EXPORT_C CDevTokenDHParams* CDevTokenDHParams::NewL(const TInteger& aN, const TInteger& aG) |
|
51 { |
|
52 RInteger n = RInteger::NewL(aN); |
|
53 CleanupStack::PushL(n); |
|
54 RInteger g = RInteger::NewL(aG); |
|
55 CleanupStack::PushL(g); |
|
56 CDevTokenDHParams* self = new (ELeave) CDevTokenDHParams(n, g); |
|
57 CleanupStack::Pop(2); // g, n |
|
58 return self; |
|
59 } |
|
60 |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // CDevTokenDHParams::TakeN() |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 EXPORT_C RInteger CDevTokenDHParams::TakeN() |
|
67 { |
|
68 RInteger result = iN; |
|
69 iN = RInteger(); |
|
70 return result; |
|
71 } |
|
72 |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // CDevTokenDHParams::TakeG() |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C RInteger CDevTokenDHParams::TakeG() |
|
79 { |
|
80 RInteger result = iG; |
|
81 iG = RInteger(); |
|
82 return result; |
|
83 } |
|
84 |
|
85 //EOF |
|
86 |