nsIKeyModule.idl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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/. */
  4. #include "nsISupports.idl"
  5. %{ C++
  6. /* forward declaration */
  7. typedef struct PK11SymKeyStr PK11SymKey;
  8. %}
  9. [ptr] native PK11SymKeyPtr(PK11SymKey);
  10. // An opaque key object.
  11. [scriptable, uuid(ee2dc516-ba7b-4e77-89fe-c43b886ef715)]
  12. interface nsIKeyObject : nsISupports
  13. {
  14. // Key types
  15. const short SYM_KEY = 1;
  16. // Algorithm types
  17. const short HMAC = 257;
  18. // The nsIKeyObject will take ownership of the key and be responsible
  19. // for freeing the key memory when destroyed.
  20. [noscript] void initKey(in short aAlgorithm, in PK11SymKeyPtr aKey);
  21. // Returns a pointer to the underlying key object.
  22. [noscript] PK11SymKeyPtr getKeyObj();
  23. short getType();
  24. };
  25. [scriptable, uuid(838bdbf1-8244-448f-8bcd-cede70227d75)]
  26. interface nsIKeyObjectFactory : nsISupports
  27. {
  28. nsIKeyObject keyFromString(in short aAlgorithm, in ACString aKey);
  29. };