SecretDecoderRing.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef SecretDecoderRing_h
  7. #define SecretDecoderRing_h
  8. #include "nsISecretDecoderRing.h"
  9. #include "nsNSSShutDown.h"
  10. #include "nsString.h"
  11. #define NS_SECRETDECODERRING_CONTRACTID "@mozilla.org/security/sdr;1"
  12. #define NS_SECRETDECODERRING_CID \
  13. { 0x0c4f1ddc, 0x1dd2, 0x11b2, { 0x9d, 0x95, 0xf2, 0xfd, 0xf1, 0x13, 0x04, 0x4b } }
  14. class SecretDecoderRing : public nsISecretDecoderRing
  15. , public nsNSSShutDownObject
  16. {
  17. public:
  18. NS_DECL_ISUPPORTS
  19. NS_DECL_NSISECRETDECODERRING
  20. SecretDecoderRing();
  21. // Nothing to release.
  22. virtual void virtualDestroyNSSReference() override {}
  23. protected:
  24. virtual ~SecretDecoderRing();
  25. private:
  26. nsresult Encrypt(const nsACString& data, /*out*/ nsACString& result);
  27. nsresult Decrypt(const nsACString& data, /*out*/ nsACString& result);
  28. };
  29. #endif // SecretDecoderRing_h