|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Collects various parameters needed in secure provisioning service url.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CIPTVSECUREPROVISIONINGPARAMETERS_H |
|
22 #define CIPTVSECUREPROVISIONINGPARAMETERS_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <etelmm.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CRepository; |
|
38 class C3DESEncryptor; |
|
39 class C3DESDecryptor; |
|
40 |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * Secure provisioning service url parameters getter. |
|
46 * @lib IptvClientApi.dll |
|
47 */ |
|
48 class CIptvSecureProvisioningParameters : public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @return pointer to new CIptvSecureProvisioningParameters instance. |
|
55 */ |
|
56 static CIptvSecureProvisioningParameters* NewL(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CIptvSecureProvisioningParameters(); |
|
62 |
|
63 public: |
|
64 /** |
|
65 * CIptvService::ESecureProvisioningServer type service needs additional dynamic |
|
66 * parameters after the address url (CIptvService::GetAddress()), this function |
|
67 * generates the dynamic part. |
|
68 * |
|
69 * @return Pointer to dynamic part of the url, caller gets ownership of the pointer. |
|
70 */ |
|
71 HBufC* SecureProvisioningUrlParametersL(); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * By default Symbian 2nd phase constructor is private. |
|
77 */ |
|
78 void ConstructL(); |
|
79 |
|
80 /** |
|
81 * Gets device model (n80, n95,...). |
|
82 * @param aModel Descriptor where model is written. |
|
83 */ |
|
84 void FetchProductModelL( TDes8& aModel ); |
|
85 |
|
86 /** |
|
87 * Writes Home network id and home country code to cenrep. |
|
88 */ |
|
89 void FetchHomeNetworkInfoL(); |
|
90 |
|
91 /** |
|
92 * Creates aFormattedMnc. |
|
93 * |
|
94 * @param aMcc Country code |
|
95 * @param aUnformattedMnc Network id |
|
96 * @param aFormattedMnc Formatted network code |
|
97 */ |
|
98 void FormatMncCodeL( |
|
99 const RMobilePhone::TMobilePhoneNetworkCountryCode aMcc, |
|
100 const RMobilePhone::TMobilePhoneNetworkIdentity aUnformattedMnc, |
|
101 RMobilePhone::TMobilePhoneNetworkIdentity& aFormattedMnc ); |
|
102 |
|
103 /** |
|
104 * Returns home country code. |
|
105 */ |
|
106 const RMobilePhone::TMobilePhoneNetworkCountryCode HomeMccL(); |
|
107 |
|
108 /** |
|
109 * Returns home network id. |
|
110 */ |
|
111 const RMobilePhone::TMobilePhoneNetworkIdentity HomeMncL(); |
|
112 |
|
113 /** |
|
114 * Sets home country code to central repository. |
|
115 * @param aMcc home country code. |
|
116 */ |
|
117 void SetHomeMccL( const RMobilePhone::TMobilePhoneNetworkCountryCode aMcc ); |
|
118 |
|
119 /** |
|
120 * Sets home network id to central repository. |
|
121 * @param aMnc home network ID. |
|
122 */ |
|
123 void SetHomeMncL( const RMobilePhone::TMobilePhoneNetworkIdentity aMnc ); |
|
124 |
|
125 /** |
|
126 * Gets key info from cenrep. |
|
127 * @param aKeyInfo Descriptor where key info is written. |
|
128 */ |
|
129 void GetKeyInfoL( TDes8& aKeyInfo ); |
|
130 |
|
131 /** |
|
132 * Creates nonce and saves it to central repository. |
|
133 * @param aTimeOut not used. |
|
134 * @param aNonce new nonce is written here. |
|
135 */ |
|
136 void CreateNewNonceL( const TUint /*aTimeOut*/, TDes8& aNonce ); |
|
137 |
|
138 /** |
|
139 * Returns random charachter. |
|
140 * @param aSeed a number which is used to initialize random generator. |
|
141 */ |
|
142 TUint RandomCharacter( TInt64& aSeed ); |
|
143 |
|
144 private: |
|
145 |
|
146 /** |
|
147 * Pointer to repository, used for storing dynamic url parameter fields. |
|
148 * Own. |
|
149 */ |
|
150 CRepository* iRepository; |
|
151 |
|
152 #ifndef __WINS__ // encryptor is not used in emulator |
|
153 |
|
154 /** |
|
155 * Used for encrypting nounce to central repository. |
|
156 * Own. |
|
157 */ |
|
158 C3DESEncryptor* iEncryptor; |
|
159 #endif |
|
160 |
|
161 RTelServer iServer; |
|
162 RMobilePhone iPhone; |
|
163 |
|
164 }; |
|
165 |
|
166 #endif // CIPTVSECUREPROVISIONINGPARAMETERS_H |
|
167 |
|
168 // End of File |