|
1 /* |
|
2 * Copyright (c) 2003 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: This file defines RightsServer.exe's client/server interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DRMENGINECLIENTSERVER_H |
|
20 #define DRMENGINECLIENTSERVER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 // #include <e32uid.h> |
|
25 |
|
26 // Added namespace to prevent namespace pollution (TDRMCommand). |
|
27 namespace DRMEngine |
|
28 { |
|
29 // CONSTANTS |
|
30 const TUint8 KServerMajorVersion = 3; |
|
31 const TUint8 KServerMinorVersion = 0; |
|
32 const TUint16 KServerBuildVersion = 0; |
|
33 |
|
34 const TInt KServerUID = 0x101F51F2; |
|
35 const TInt KNullUID = 0x0; |
|
36 const TInt KMaxOmaV1CIDLength = 256; |
|
37 |
|
38 _LIT( KDRMSemaphore, "RightsServerSem" ); |
|
39 |
|
40 _LIT( KServerName, "!RightsServer" ); |
|
41 |
|
42 // MACROS |
|
43 // DATA TYPES |
|
44 |
|
45 enum TCommand |
|
46 { |
|
47 /* |
|
48 Command: failsafe |
|
49 */ |
|
50 ENone, /* 0 */ |
|
51 |
|
52 /* |
|
53 Command: Add a new rights object into database. |
|
54 Params: |
|
55 TDesC8( CID ), |
|
56 TPtr8( TRightsObject ), |
|
57 TDesC8( CEK ), |
|
58 TDes8( Unique ID ) |
|
59 */ |
|
60 EAddRecord, |
|
61 |
|
62 /* |
|
63 Command: Get single rights object. |
|
64 Params: |
|
65 TPckg8<TInt>, |
|
66 NULL, |
|
67 TPtrC8( TDRMUniqueID ), |
|
68 TDesC8( CID ) |
|
69 */ |
|
70 EGetDbEntry, |
|
71 |
|
72 /* |
|
73 Command: Get list of rights objects and store the list |
|
74 into a temporary file. |
|
75 Params: |
|
76 TFileName( temp file ), |
|
77 TDesC8( CID ), |
|
78 */ |
|
79 EGetEntryList, |
|
80 |
|
81 /* |
|
82 Command: Delete all ROs with certain CID. |
|
83 Params: |
|
84 NULL, |
|
85 NULL, |
|
86 TDesC8( CID ) |
|
87 */ |
|
88 EDeleteWithCID, |
|
89 |
|
90 /* |
|
91 Command: Delete one RO, identified with UID & CID. |
|
92 Params: |
|
93 TPtr8( TDRMUniqueID ) |
|
94 NULL, |
|
95 NULL, |
|
96 TDesC8( Content-ID ) |
|
97 */ |
|
98 EDeleteRO, /* 5 */ |
|
99 |
|
100 /* |
|
101 Command: Export Content-ID list into a file. |
|
102 Params: |
|
103 TDes( File name ) |
|
104 */ |
|
105 EExportCIDs, |
|
106 |
|
107 /* |
|
108 Command: Get decryption key, update rights if said to do so. |
|
109 Params: |
|
110 TInt( usage intention ), |
|
111 TDesC8( content ID ), |
|
112 TDRMKey( key ), |
|
113 */ |
|
114 EGetKey, |
|
115 |
|
116 /* |
|
117 Command: Check whether there is available rights. |
|
118 Params: |
|
119 TInt( usage intention ), |
|
120 TDesC8( content ID ) |
|
121 */ |
|
122 ECheckRights, |
|
123 /* |
|
124 Command: Return how many rights object there is in the DB. |
|
125 Params: |
|
126 TPtr8( integer ) |
|
127 */ |
|
128 ECount, |
|
129 |
|
130 /* |
|
131 Command: Delete every RO from the database. |
|
132 Params: |
|
133 - |
|
134 */ |
|
135 EDeleteAll, /* 10 */ |
|
136 |
|
137 /* |
|
138 Command: Consume the right with database |
|
139 Params: |
|
140 TDesC8( content ID ) |
|
141 */ |
|
142 EConsume, |
|
143 |
|
144 /* |
|
145 Command: Calculate the padding from file ending |
|
146 Params: |
|
147 TDesC8( content ID ) |
|
148 TDesC8( last two data blocks ) |
|
149 */ |
|
150 ECalculatePadding, |
|
151 |
|
152 /* |
|
153 Command: Get the secure time and trust level. |
|
154 Params: |
|
155 TPckg< TInt64 > time |
|
156 TPckg< TBool > trust level |
|
157 */ |
|
158 ESecureTime, |
|
159 |
|
160 /* |
|
161 Command: Add a protected rights object into database. |
|
162 Params: |
|
163 TDesC8( CID ), |
|
164 TPtr8( TRightsObject ), |
|
165 TDesC8( REK + CEK + MAC), |
|
166 TDes8( Unique ID ) |
|
167 */ |
|
168 EAddProtectedRecord, |
|
169 |
|
170 /* |
|
171 Command: Add a domain rights object into database. |
|
172 Params: |
|
173 TDesC8( CID ), |
|
174 TPtr8( TRightsObject ), |
|
175 TDesC8( wrapped CEK ), |
|
176 TDes8( Unique ID ) |
|
177 */ |
|
178 EAddDomainRecord, /* 15 */ |
|
179 |
|
180 |
|
181 /* |
|
182 Command: Gets the prepared data from the server size |
|
183 TPtr8( data ) |
|
184 */ |
|
185 EGetPreparedData, |
|
186 |
|
187 /* |
|
188 Command: Adds the domain ro xml representation to the server |
|
189 TDesC8( RoId ) |
|
190 TDesC8( XmlData ) |
|
191 */ |
|
192 EAddDomainRO, |
|
193 |
|
194 /* |
|
195 Command: Gets the domain ro xml representation from the server |
|
196 TDesC8( RoId ) |
|
197 */ |
|
198 EGetDomainRO, |
|
199 |
|
200 /* |
|
201 Command: Deletes the domain ro xml representation from the server |
|
202 TDesC8( RoId ) |
|
203 */ |
|
204 EDeleteDomainRO, |
|
205 |
|
206 /* |
|
207 Command: Checks whether the item is in Replay Cache. |
|
208 TDesC8( ID ) |
|
209 TPckgC< TTime > |
|
210 TPckg< TBool return value > |
|
211 */ |
|
212 EIsInCache, /* 20 */ |
|
213 |
|
214 /* |
|
215 Command: Add an entry to Replay Cache. |
|
216 TDesC8( ID ) |
|
217 TPckgC< TTime > |
|
218 */ |
|
219 EAddToCache, |
|
220 |
|
221 /* |
|
222 Command: Initialize the session key |
|
223 TDesC8( content ID ) |
|
224 */ |
|
225 EInitializeKey, |
|
226 |
|
227 /* |
|
228 Command: Initialize the session key from a group key |
|
229 TDesC8( group ID ) |
|
230 TDesC8( group Key ) |
|
231 TInt( encryption method ) |
|
232 */ |
|
233 EInitializeGroupKey, |
|
234 |
|
235 /* |
|
236 Command: Decrypt data using the session key |
|
237 TDesC8( initialization vector ) |
|
238 TBool( remove padding? ) |
|
239 TPtr8( data ) |
|
240 */ |
|
241 EDecrypt, |
|
242 |
|
243 /* |
|
244 Command: Encrypt data using the session key |
|
245 TDesC8( initialization vector ) |
|
246 TBool( add padding? ) |
|
247 TPtr8( data ) |
|
248 */ |
|
249 EEncrypt, /* 25 */ |
|
250 |
|
251 /* |
|
252 Command: Get the domain RO as XML for the given content ID |
|
253 TDesC8( content ID ) |
|
254 TPtr8( RO as XML ) |
|
255 */ |
|
256 EGetDomainRoForCid, |
|
257 |
|
258 /* |
|
259 Command: Check if consume is possible |
|
260 Params: |
|
261 TInt( intent ) |
|
262 TDesC8( content ID ) |
|
263 */ |
|
264 ECheckConsume, |
|
265 |
|
266 /* |
|
267 Command: Delete expired permissions. |
|
268 */ |
|
269 EDeleteExpired, |
|
270 |
|
271 /* |
|
272 Command: Set the estimated arrival time |
|
273 Params: |
|
274 TDesC8( content ID ) |
|
275 TTimeIntervalSeconds( time until arrival ) |
|
276 */ |
|
277 ESetEstimatedArrival, |
|
278 |
|
279 /* |
|
280 Command: Get the estimated arrival time |
|
281 Params: |
|
282 TDesC8( content ID ) |
|
283 TTimeIntervalSeconds( time until arrival ) |
|
284 */ |
|
285 EGetEstimatedArrival, /* 30 */ |
|
286 |
|
287 /* |
|
288 Command: Set name |
|
289 Params: |
|
290 TDesC8( content-ID) |
|
291 TDesC( name ) |
|
292 */ |
|
293 ESetName, |
|
294 |
|
295 /* |
|
296 Command: Get name |
|
297 Params: |
|
298 TDesC8( content-ID) |
|
299 TPckgBuf< TInt >( data lengt to be returned ) |
|
300 */ |
|
301 EGetName, |
|
302 |
|
303 /* |
|
304 Command: Gets the prepared data from the server size |
|
305 TPtr( data ) |
|
306 */ |
|
307 EGetWideData, |
|
308 |
|
309 /* |
|
310 Command: Cancel |
|
311 */ |
|
312 ECancel, |
|
313 |
|
314 /* |
|
315 Command: Get Udt Data |
|
316 TDesC8( UDT Data ); |
|
317 */ |
|
318 EGetUdtData, /* 35 */ |
|
319 |
|
320 /* |
|
321 Command: Initiate Udt |
|
322 TDesC8( key ) |
|
323 */ |
|
324 EInitiateUdt, |
|
325 |
|
326 /* |
|
327 Command: Export Orphaned Content-ID list into a file. |
|
328 Params: |
|
329 TBool( perform file scan ) |
|
330 */ |
|
331 EInitOrphanedList, |
|
332 |
|
333 /* |
|
334 Command: Export Orphaned Content-ID list into a file. |
|
335 Params: |
|
336 TDes( File name ) |
|
337 */ |
|
338 EGetOrphanedList, |
|
339 |
|
340 /* |
|
341 Command: Get FL URI. |
|
342 Params: |
|
343 TBuf8< 256 >( URI ) |
|
344 */ |
|
345 EGetFLUri, |
|
346 |
|
347 /* |
|
348 Command: Encode rights issuer url. |
|
349 Params: |
|
350 TPtr8( original ), room for result also. |
|
351 */ |
|
352 EEncodeRightsIssuerField, /* 40 */ |
|
353 |
|
354 /* |
|
355 Command: Decode rights issuer url. |
|
356 Params: |
|
357 TDesC8( original ). |
|
358 TPtr8( decoded ) |
|
359 */ |
|
360 EDecodeRightsIssuerField, |
|
361 |
|
362 /* |
|
363 Command: Set the authentication seed for a content ID |
|
364 Params: |
|
365 TDesC8( content ID) |
|
366 TDesC8( authentication seed ) |
|
367 */ |
|
368 ESetAuthenticationSeed, |
|
369 |
|
370 /* |
|
371 Command: Get the authentication seed for a content ID |
|
372 Params: |
|
373 TDesC8( content ID) |
|
374 TPtr8( authentication seed ) |
|
375 */ |
|
376 EGetAuthenticationSeed, |
|
377 |
|
378 /* |
|
379 Command: Verify the MAC |
|
380 Params: |
|
381 TDesC8( RO element) |
|
382 TDesC8( MAC value ) |
|
383 */ |
|
384 EVerifyMac, |
|
385 |
|
386 /* |
|
387 Command: Get the supported individuals list |
|
388 Params: |
|
389 RPointerArray<HBufC8> |
|
390 */ |
|
391 EGetSupportedIndividuals, /* 45 */ |
|
392 |
|
393 /* |
|
394 Command: Stop watching the DCF repository server |
|
395 */ |
|
396 EStopWatching, |
|
397 |
|
398 /* |
|
399 Command: Unwraps public key encrypted MAC and REK keys. |
|
400 Params: |
|
401 TDesC8 aMacAndRek, |
|
402 TKeyTransportScheme& aTransScheme, |
|
403 TDesC8 aRiID |
|
404 */ |
|
405 EUnwrapDeviceMacAndRek, |
|
406 |
|
407 /* |
|
408 Command: Unwraps domain key encrypted MAC and REK keys. |
|
409 Params: |
|
410 TDesC8 aMacAndRek, |
|
411 TKeyTransportScheme& aTransScheme, |
|
412 TDesC8 aRiID |
|
413 */ |
|
414 EUnwrapDomainMacAndRek, |
|
415 |
|
416 /* |
|
417 Command: Fills the given buffer with random data |
|
418 Params: |
|
419 TDesC8 aRandomData, |
|
420 */ |
|
421 EGetRandomData, |
|
422 |
|
423 /* |
|
424 Command: Wrap metering data per RiId |
|
425 Params: |
|
426 TDesC8 aRiId, |
|
427 */ |
|
428 EGetMeteringData, /* 50 */ |
|
429 |
|
430 /* |
|
431 Command: Delete metering data per RiId |
|
432 Params: |
|
433 TDesC8 aRiId, |
|
434 */ |
|
435 EDeleteMeteringData |
|
436 }; |
|
437 } |
|
438 |
|
439 #endif // DRMENGINECLIENTSERVER_H |
|
440 |
|
441 // End of File |