|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #ifndef _NS_STREAMCIPHER_H_ |
|
6 #define _NS_STREAMCIPHER_H_ |
|
7 |
|
8 #include "nsIStreamCipher.h" |
|
9 #include "nsString.h" |
|
10 #include "pk11func.h" |
|
11 #include "mozilla/Attributes.h" |
|
12 |
|
13 /* dbfcbe4a-10f7-4d6f-a481-68e6d6b71d21 */ |
|
14 #define NS_STREAMCIPHER_CID \ |
|
15 { 0xdbfcbe4a, 0x10f7, 0x4d6f, {0xa4, 0x81, 0x68, 0xe6, 0xd6, 0xb7, 0x1d, 0x21}} |
|
16 #define NS_STREAMCIPHER_CONTRACTID "@mozilla.org/security/streamcipher;1" |
|
17 |
|
18 class nsStreamCipher MOZ_FINAL : public nsIStreamCipher |
|
19 { |
|
20 public: |
|
21 nsStreamCipher(); |
|
22 |
|
23 NS_DECL_ISUPPORTS |
|
24 NS_DECL_NSISTREAMCIPHER |
|
25 |
|
26 private: |
|
27 ~nsStreamCipher(); |
|
28 |
|
29 // Helper method for initializing this object. |
|
30 // aIV may be null. |
|
31 nsresult InitWithIV_(nsIKeyObject *aKey, SECItem* aIV); |
|
32 |
|
33 // Disallow copy constructor |
|
34 nsStreamCipher(nsStreamCipher&); |
|
35 |
|
36 // Holds our stream cipher context. |
|
37 PK11Context* mContext; |
|
38 |
|
39 // Holds the amount we've computed so far. |
|
40 nsCString mValue; |
|
41 }; |
|
42 |
|
43 #endif // _NS_STREAMCIPHER_H_ |