Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : *
3 : * This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef SecretDecoderRing_h
8 : #define SecretDecoderRing_h
9 :
10 : #include "nsISecretDecoderRing.h"
11 : #include "nsNSSShutDown.h"
12 : #include "nsString.h"
13 :
14 : #define NS_SECRETDECODERRING_CONTRACTID "@mozilla.org/security/sdr;1"
15 :
16 : #define NS_SECRETDECODERRING_CID \
17 : { 0x0c4f1ddc, 0x1dd2, 0x11b2, { 0x9d, 0x95, 0xf2, 0xfd, 0xf1, 0x13, 0x04, 0x4b } }
18 :
19 : class SecretDecoderRing : public nsISecretDecoderRing
20 : , public nsNSSShutDownObject
21 : {
22 : public:
23 : NS_DECL_ISUPPORTS
24 : NS_DECL_NSISECRETDECODERRING
25 :
26 : SecretDecoderRing();
27 :
28 : // Nothing to release.
29 0 : virtual void virtualDestroyNSSReference() override {}
30 :
31 : protected:
32 : virtual ~SecretDecoderRing();
33 :
34 : private:
35 : nsresult Encrypt(const nsACString& data, /*out*/ nsACString& result);
36 : nsresult Decrypt(const nsACString& data, /*out*/ nsACString& result);
37 : };
38 :
39 : #endif // SecretDecoderRing_h
|