nsNSSHelper.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 NSS_HELPER_
  7. #define NSS_HELPER_
  8. #include "nsIInterfaceRequestor.h"
  9. #include "nsIInterfaceRequestorUtils.h"
  10. #include "nsNSSShutDown.h"
  11. #include "pk11func.h"
  12. //
  13. // Implementation of an nsIInterfaceRequestor for use
  14. // as context for NSS calls
  15. //
  16. class PipUIContext : public nsIInterfaceRequestor
  17. {
  18. public:
  19. NS_DECL_THREADSAFE_ISUPPORTS
  20. NS_DECL_NSIINTERFACEREQUESTOR
  21. PipUIContext();
  22. protected:
  23. virtual ~PipUIContext();
  24. };
  25. //
  26. // Function to get the implementor for a certain set of NSS
  27. // specific dialogs.
  28. //
  29. nsresult
  30. getNSSDialogs(void **_result, REFNSIID aIID, const char *contract);
  31. extern "C" {
  32. // a "fake" unicode conversion function
  33. PRBool
  34. pip_ucs2_ascii_conversion_fn(PRBool toUnicode,
  35. unsigned char *inBuf,
  36. unsigned int inBufLen,
  37. unsigned char *outBuf,
  38. unsigned int maxOutBufLen,
  39. unsigned int *outBufLen,
  40. PRBool swapBytes);
  41. }
  42. //
  43. // A function that sets the password on an unitialized slot.
  44. //
  45. nsresult
  46. setPassword(PK11SlotInfo* slot, nsIInterfaceRequestor* ctx,
  47. nsNSSShutDownPreventionLock& /*proofOfLock*/);
  48. #endif