Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
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/. */
5 #ifndef _NS_KEYMODULE_H_
6 #define _NS_KEYMODULE_H_
8 #include "nsIKeyModule.h"
9 #include "pk11pub.h"
10 #include "mozilla/Attributes.h"
12 /* eae599aa-ecef-49c6-a8af-6ddcc6feb484 */
13 #define NS_KEYMODULEOBJECT_CID \
14 { 0xeae599aa, 0xecef, 0x49c6, {0xa8, 0xaf, 0x6d, 0xdc, 0xc6, 0xfe, 0xb4, 0x84} }
15 #define NS_KEYMODULEOBJECT_CONTRACTID "@mozilla.org/security/keyobject;1"
17 /* a39e0e9d-e567-41e3-b12c-5df67f18174d */
18 #define NS_KEYMODULEOBJECTFACTORY_CID \
19 { 0xa39e0e9d, 0xe567, 0x41e3, {0xb1, 0x2c, 0x5d, 0xf6, 0x7f, 0x18, 0x17, 0x4d} }
20 #define NS_KEYMODULEOBJECTFACTORY_CONTRACTID \
21 "@mozilla.org/security/keyobjectfactory;1"
23 class nsKeyObject MOZ_FINAL : public nsIKeyObject
24 {
25 public:
26 nsKeyObject();
28 NS_DECL_ISUPPORTS
29 NS_DECL_NSIKEYOBJECT
31 private:
32 ~nsKeyObject();
34 // Disallow copy constructor
35 nsKeyObject(nsKeyObject&);
37 // 0 if not yet set, otherwise one of the nsIKeyObject::*KEY values
38 uint32_t mKeyType;
40 // A union of our possible key types
41 PK11SymKey* mSymKey;
42 SECKEYPrivateKey* mPrivateKey;
43 SECKEYPublicKey* mPublicKey;
45 // Helper method to free memory used by keys.
46 void CleanUp();
47 };
50 class nsKeyObjectFactory MOZ_FINAL : public nsIKeyObjectFactory
51 {
52 public:
53 nsKeyObjectFactory();
55 NS_DECL_THREADSAFE_ISUPPORTS
56 NS_DECL_NSIKEYOBJECTFACTORY
58 private:
59 ~nsKeyObjectFactory() {}
61 // Disallow copy constructor
62 nsKeyObjectFactory(nsKeyObjectFactory&);
63 };
65 #endif // _NS_KEYMODULE_H_