|
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: Class is used for configuring secure RTP. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMCCSECURECINTERFACE_H |
|
22 #define MMCCSECURECINTERFACE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <mmccinterface.h> |
|
27 |
|
28 // CONSTANTS |
|
29 const TInt KMccLinkSecure = 110; |
|
30 const TInt KMccLinkSecureVideo = 111; |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CMccInterface; |
|
34 class CMccCryptoContextContainer; |
|
35 class TMccCryptoContext; |
|
36 |
|
37 /** |
|
38 * MCC subsystem client interface for secure sessions. |
|
39 * |
|
40 * @lib mmccinterface.lib |
|
41 */ |
|
42 class CMccSecureInterface : public CBase |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aInterface reference to MCC interface. |
|
49 * @return CMccSecureInterface* Pointer to the secure interface object created |
|
50 */ |
|
51 IMPORT_C static CMccSecureInterface* NewL( CMccInterface& aInterface ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CMccSecureInterface(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Creates new crypto context. |
|
62 * @since Series 60 3.2 |
|
63 * @param aMasterKey The master key value. |
|
64 * @param aSaltKey The master salt value. |
|
65 * @param aContextId ID of the new context if successful. |
|
66 * @param aParams Crypto context optional parameters. |
|
67 * @return KErrNone if success; otherwise system wide error code. |
|
68 */ |
|
69 IMPORT_C TInt CreateContext( const TDesC8& aMasterKey, const TDesC8& aSaltKey, |
|
70 TUint32& aContextId, const TDesC8& aParams ); |
|
71 |
|
72 /** |
|
73 * Updates existing crypto context. |
|
74 * @since Series 60 3.2 |
|
75 * @param aMasterKey The master key value. |
|
76 * @param aSaltKey The master salt value. |
|
77 * @param aContextId ID of the updated context. |
|
78 * @param aParams Crypto context optional parameters. |
|
79 * @return KErrNone if success; otherwise system wide error code. |
|
80 */ |
|
81 IMPORT_C TInt UpdateContext( const TDesC8& aMasterKey, const TDesC8& aSaltKey, |
|
82 TUint32 aContextId, const TDesC8& aParams ); |
|
83 /** |
|
84 * Removes existing crypto context. |
|
85 * @since Series 60 3.2 |
|
86 * @param aContextId ID of the context to be removed. |
|
87 * @return KErrNone if success; otherwise system wide error code. |
|
88 */ |
|
89 IMPORT_C TInt RemoveContext( TUint32 aContextId ); |
|
90 |
|
91 /** |
|
92 * Binds crypto context into stream. Binding must be done |
|
93 * before stream is prepared. |
|
94 * @since Series 60 3.2 |
|
95 * @param aSessionId ID of session. |
|
96 * @param aLinkId ID of link. |
|
97 * @param aStreamId ID of stream. |
|
98 * @param aEndpointId ID identifying endpoint of the stream. |
|
99 * @param aContextId ID of context. |
|
100 * @return KErrNone if success; |
|
101 * KErrArgument if context is already binded. |
|
102 * Otherwise one of the standard system-wide error codes. |
|
103 */ |
|
104 IMPORT_C TInt Bind( TUint32 aSessionId, TUint32 aLinkId, |
|
105 TUint32 aStreamId, TUint32 aEndPointId, |
|
106 TUint32 aContextId ); |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 * C++ default constructor. |
|
112 */ |
|
113 CMccSecureInterface( CMccInterface& aController ); |
|
114 |
|
115 /** |
|
116 * By default Symbian 2nd phase constructor is private. |
|
117 */ |
|
118 void ConstructL( ); |
|
119 |
|
120 private: |
|
121 |
|
122 /** |
|
123 * Instance of Mcc interface. |
|
124 */ |
|
125 CMccInterface& iInterface; |
|
126 |
|
127 /** |
|
128 * Contains unique ID of controller interface |
|
129 */ |
|
130 TMMFMessageDestinationPckg iMessageDest; |
|
131 |
|
132 /** |
|
133 * Handle to the controller plugin for sending custom commands |
|
134 */ |
|
135 RMMFController iController; |
|
136 |
|
137 /** |
|
138 * Crypto context container for context containing and handling |
|
139 * Own. |
|
140 */ |
|
141 CMccCryptoContextContainer* iContextContainer; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif /* MMCCSECUREINTERFACE_H */ |