nsIU2FToken.idl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. interface nsIArray;
  6. /**
  7. * Interface used to interact with U2F Token devices
  8. */
  9. [scriptable, uuid(5778242f-1f42-47a2-b514-fa1adde2d904)]
  10. interface nsIU2FToken : nsISupports {
  11. /**
  12. * Is this token compatible with the provided version?
  13. *
  14. * @param version The offered version to test
  15. * @return True if the offered version is compatible
  16. */
  17. void isCompatibleVersion(in AString version, [retval] out boolean result);
  18. /**
  19. * Return whether the provided KeyHandle belongs to this Token
  20. *
  21. * @param keyHandle Key Handle to evaluate.
  22. * @return True if the Key Handle is ours.
  23. */
  24. void isRegistered([array, size_is(keyHandleLen)] in octet keyHandle,
  25. in uint32_t keyHandleLen,
  26. [retval] out boolean result);
  27. /**
  28. * Generates a public/private keypair for the provided application
  29. * and challenge, returning the pubkey, challenge response, and
  30. * key handle in the registration data.
  31. *
  32. * @param application The FIDO Application data to associate with the key.
  33. * @param challenge The Challenge to satisfy in the response.
  34. * @param registration An array containing the pubkey, challenge response,
  35. * and key handle.
  36. */
  37. void register([array, size_is(applicationLen)] in octet application,
  38. in uint32_t applicationLen,
  39. [array, size_is(challengeLen)] in octet challenge,
  40. in uint32_t challengeLen,
  41. [array, size_is(registrationLen)] out octet registration,
  42. out uint32_t registrationLen);
  43. /**
  44. * Creates a signature over the "param" arguments using the private key
  45. * provided in the key handle argument.
  46. *
  47. * @param application The FIDO Application data to associate with the key.
  48. * @param challenge The Challenge to satisfy in the response.
  49. * @param keyHandle The Key Handle opaque object to use.
  50. * @param signature The resulting signature.
  51. */
  52. void sign([array, size_is(applicationLen)] in octet application,
  53. in uint32_t applicationLen,
  54. [array, size_is(challengeLen)] in octet challenge,
  55. in uint32_t challengeLen,
  56. [array, size_is(keyHandleLen)] in octet keyHandle,
  57. in uint32_t keyHandleLen,
  58. [array, size_is(signatureLen)] out octet signature,
  59. out uint32_t signatureLen);
  60. };