|
1 /* |
|
2 * Copyright (c) 2005-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 * CEncryptedProtectionKey implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #include "authserver_impl.h" |
|
25 |
|
26 |
|
27 using namespace AuthServer; |
|
28 |
|
29 CEncryptedProtectionKey* CEncryptedProtectionKey::NewL(HBufC8* aKeyData) |
|
30 { |
|
31 CEncryptedProtectionKey* key = |
|
32 CEncryptedProtectionKey::NewLC(aKeyData); |
|
33 CleanupStack::Pop(key); |
|
34 return key; |
|
35 } |
|
36 |
|
37 CEncryptedProtectionKey* CEncryptedProtectionKey::NewLC(HBufC8* aKeyData) |
|
38 { |
|
39 CEncryptedProtectionKey* key = new (ELeave) CEncryptedProtectionKey(); |
|
40 CleanupStack::PushL(key); |
|
41 key->ConstructL(aKeyData); |
|
42 return key; |
|
43 } |
|
44 |
|
45 void CEncryptedProtectionKey::ConstructL(HBufC8* aKeyData) |
|
46 { |
|
47 iKeyData = aKeyData; |
|
48 } |
|
49 |
|
50 CEncryptedProtectionKey::~CEncryptedProtectionKey() |
|
51 { |
|
52 delete iKeyData; |
|
53 } |
|
54 |
|
55 void CEncryptedProtectionKey::InternalizeL(RReadStream& aSrcData) |
|
56 { |
|
57 iKeyData = HBufC8::NewL(aSrcData, aSrcData.Source()->SizeL()); |
|
58 } |
|
59 |
|
60 |
|
61 void CEncryptedProtectionKey::ExternalizeL(RWriteStream& aDest) const |
|
62 { |
|
63 aDest << *iKeyData; |
|
64 } |
|
65 |
|
66 |
|
67 TPtrC8 CEncryptedProtectionKey::KeyData() const |
|
68 { |
|
69 return *iKeyData; |
|
70 } |
|
71 |
|
72 CEncryptedProtectionKey* CEncryptedProtectionKey::NewL(RReadStream& aSrcData) |
|
73 { |
|
74 CEncryptedProtectionKey* key = NewLC(aSrcData); |
|
75 CleanupStack::Pop(key); |
|
76 return key; |
|
77 } |
|
78 |
|
79 CEncryptedProtectionKey* CEncryptedProtectionKey::NewLC(RReadStream& aSrcData) |
|
80 { |
|
81 CEncryptedProtectionKey* key = new (ELeave) CEncryptedProtectionKey(); |
|
82 CleanupStack::PushL(key); |
|
83 key->InternalizeL(aSrcData); |
|
84 return key; |
|
85 } |
|
86 |