|
1 /* |
|
2 * Copyright (c) 2002-2004 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMLACRYPTO_H |
|
21 #define CMLACRYPTO_H |
|
22 |
|
23 #include <bigint.h> |
|
24 #include "Oma2Agent.h" |
|
25 #include "OmaCrypto.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MDrmKeyStorage; |
|
29 class CRSAPublicKey; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CmlaCrypto: Contains crypto operations for CMLA |
|
35 * |
|
36 * @lib - |
|
37 * @since 3.0 |
|
38 */ |
|
39 class CmlaCrypto: public OmaCrypto |
|
40 { |
|
41 public: // Constants |
|
42 |
|
43 static const TInt KDdtPermLength = 8; |
|
44 static const TInt KDdtExpLength = 3; |
|
45 |
|
46 public: // New functions |
|
47 |
|
48 IMPORT_C static TInt SupportedAlgorithmsL( |
|
49 RArray<TPtrC8>& aAlgorithmList); |
|
50 |
|
51 IMPORT_C static HBufC8* DdtPermL( |
|
52 const TDesC8& aInput); |
|
53 |
|
54 IMPORT_C static HBufC8* DdtPermInvL( |
|
55 const TDesC8& aInput); |
|
56 |
|
57 IMPORT_C static HBufC8* DdtExpL( |
|
58 const TDesC8& aInput); |
|
59 |
|
60 IMPORT_C static HBufC8* DdtExpInvL( |
|
61 const TDesC8& aInput); |
|
62 |
|
63 IMPORT_C static HBufC8* WrapL( |
|
64 const TDesC8& aKek, |
|
65 const TDesC8& aKey); |
|
66 |
|
67 IMPORT_C static HBufC8* UnwrapL( |
|
68 const TDesC8& aKek, |
|
69 const TDesC8& aKey); |
|
70 |
|
71 IMPORT_C static HBufC8* KdfL( |
|
72 const TDesC8& aInput); |
|
73 |
|
74 IMPORT_C static HBufC8* RsaDecryptCmlaL( |
|
75 MDrmKeyStorage* aKeyStorage, |
|
76 const TDesC8& aInput); |
|
77 |
|
78 IMPORT_C static HBufC8* RsaEncryptCmlaL( |
|
79 CRSAPublicKey* aKey, |
|
80 const TDesC8& aInput); |
|
81 |
|
82 IMPORT_C static void CmlaIpDecryptL( |
|
83 TKeyTransportScheme aTransportScheme, |
|
84 MDrmKeyStorage* aKey, |
|
85 const TDesC8& aInput, |
|
86 TDes8& aRek, |
|
87 TDes8& aMac); |
|
88 |
|
89 IMPORT_C static HBufC8* CmlaIpEncryptL( |
|
90 TKeyTransportScheme aTransportScheme, |
|
91 CRSAPublicKey* aKey, |
|
92 const TDesC8& aRek, |
|
93 const TDesC8& aMac); |
|
94 |
|
95 IMPORT_C static TKeyTransportScheme AlgorithmIdToTransportScheme( |
|
96 const TDesC8& aAlgorithmId); |
|
97 |
|
98 |
|
99 protected: // New functions |
|
100 }; |
|
101 |
|
102 #endif // CMLACRYPTO_H |
|
103 |
|
104 // End of File |