|
1 /* |
|
2 * Copyright (c) 2005 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: implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MSRTPCRYPTOHANDLERCONTEXT_H |
|
21 #define MSRTPCRYPTOHANDLERCONTEXT_H |
|
22 |
|
23 #include <e32std.h> |
|
24 |
|
25 |
|
26 // CLASS DECLARATION |
|
27 /* |
|
28 * A context for stream classes for using common crypto handling operations. |
|
29 * These are common for both RTP and RTCP |
|
30 * |
|
31 * @lib n/a |
|
32 */ |
|
33 class MSRTPCryptoHandlerContext |
|
34 { |
|
35 public: |
|
36 /* |
|
37 * virtual function for initializing |
|
38 * plain packet class (CSRTPPacketRTP or CSRTPPacketRTCP) |
|
39 * @param aPacket RTP/RTCP packet. |
|
40 * @leave KErrNone if success, system-wide error code otherwise |
|
41 * @return void |
|
42 */ |
|
43 virtual void InitializePlainPacketL(const TDesC8& aPacket) = 0; |
|
44 |
|
45 /* |
|
46 * virtual function for initializing |
|
47 * encrypted packet class (CSRTPPacketSRTP or CSRTPPacketSRTCP) |
|
48 * @param aPacket SRTP/SRTCP packet. |
|
49 * @leave KErrNone if success, system-wide error code otherwise |
|
50 * @return void |
|
51 */ |
|
52 virtual void InitializeEncryptedPacketL(const TDesC8& aPacket) = 0; |
|
53 |
|
54 /* |
|
55 * virtual function for deriving session keys |
|
56 * @leave KErrNone if success, system-wide error code otherwise |
|
57 * @return void |
|
58 */ |
|
59 virtual void DeriveSessionKeysL() = 0; |
|
60 |
|
61 /* |
|
62 * virtual function for checking that crypto context MKI and |
|
63 * packet MKI match. |
|
64 * @leave KErrNone if success, system-wide error code otherwise |
|
65 * @return void |
|
66 */ |
|
67 virtual void CheckMasterKeyIdentifierL() = 0; |
|
68 |
|
69 /* |
|
70 * virtual function for performing the authentication step |
|
71 * @leave KErrNone if success, system-wide error code otherwise |
|
72 * @return void |
|
73 */ |
|
74 virtual void AuthenticateL() = 0; |
|
75 |
|
76 /* |
|
77 * virtual function for performing the replay protection step |
|
78 * @leave KErrNone if success, system-wide error code otherwise |
|
79 * @return void |
|
80 */ |
|
81 virtual void ReplayProtectionL() = 0; |
|
82 |
|
83 /* |
|
84 * virtual function for encrypting plain packet |
|
85 * @leave KErrNone if success, system-wide error code otherwise |
|
86 * @return encrypted packet |
|
87 */ |
|
88 virtual HBufC8* EncryptL() = 0; |
|
89 |
|
90 /* |
|
91 * virtual function for decrypting ciphered packet |
|
92 * @leave KErrNone if success, system-wide error code otherwise |
|
93 * @return plain packet |
|
94 */ |
|
95 virtual HBufC8* DecryptL() = 0; |
|
96 |
|
97 /* |
|
98 * virtual function for querying whether master key or salt has been updated |
|
99 * @return master keys update status |
|
100 */ |
|
101 virtual TBool MasterKeysUpdated() = 0; |
|
102 |
|
103 /* |
|
104 * virtual function for incrementing Replay Protection Index after |
|
105 * the packet has been authenticated |
|
106 * @return void |
|
107 */ |
|
108 virtual void AddReplayIndex() =0; |
|
109 }; |
|
110 #endif //MSRTPCryptoHandlerContext_H |