nsNSSU2FToken.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsNSSU2FToken_h
  6. #define nsNSSU2FToken_h
  7. #include "nsINSSU2FToken.h"
  8. #include "nsNSSShutDown.h"
  9. #include "ScopedNSSTypes.h"
  10. #define NS_NSSU2FTOKEN_CID \
  11. {0x79f95a6c, 0xd0f7, 0x4d7d, {0xae, 0xaa, 0xcd, 0x0a, 0x04, 0xb6, 0x50, 0x89}}
  12. class nsNSSU2FToken : public nsINSSU2FToken,
  13. public nsNSSShutDownObject
  14. {
  15. public:
  16. NS_DECL_ISUPPORTS
  17. NS_DECL_NSIU2FTOKEN
  18. NS_DECL_NSINSSU2FTOKEN
  19. nsNSSU2FToken();
  20. // For nsNSSShutDownObject
  21. virtual void virtualDestroyNSSReference() override;
  22. void destructorSafeDestroyNSSReference();
  23. private:
  24. bool mInitialized;
  25. mozilla::UniquePK11SymKey mWrappingKey;
  26. static const nsCString mSecretNickname;
  27. static const nsString mVersion;
  28. ~nsNSSU2FToken();
  29. nsresult GetOrCreateWrappingKey(const mozilla::UniquePK11SlotInfo& aSlot,
  30. const nsNSSShutDownPreventionLock&);
  31. };
  32. #endif // nsNSSU2FToken_h