1 /* -*- Mode: IDL; tab-width: 2; 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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is a combination of the FIDO U2F Raw Message Formats:
7 * https://www.fidoalliance.org/specs/fido-u2f-v1.1-id-20160915/fido-u2f-raw-message-formats-v1.1-id-20160915.html
8 * and the U2F JavaScript API v1.1:
9 * https://www.fidoalliance.org/specs/fido-u2f-v1.1-id-20160915/fido-u2f-javascript-api-v1.1-id-20160915.html
12 interface mixin GlobalU2F {
13 [SecureContext, Throws, Pref="security.webauth.u2f"]
14 readonly attribute U2F u2f;
17 typedef unsigned short ErrorCode;
18 typedef sequence<Transport> Transports;
27 dictionary U2FClientData {
28 DOMString typ; // Spelling is from the specification
31 // cid_pubkey for Token Binding is not implemented
34 dictionary RegisterRequest {
39 dictionary RegisterResponse {
41 DOMString registrationData;
46 DOMString? errorMessage;
49 dictionary RegisteredKey {
52 Transports? transports;
56 dictionary SignResponse {
58 DOMString signatureData;
63 DOMString? errorMessage;
66 callback U2FRegisterCallback = undefined(RegisterResponse response);
67 callback U2FSignCallback = undefined(SignResponse response);
69 [SecureContext, Pref="security.webauth.u2f"]
71 // These enumerations are defined in the FIDO U2F Javascript API under the
72 // interface "ErrorCode" as constant integers, and also in the U2F.cpp file.
73 // Any changes to these must occur in both locations.
74 const unsigned short OK = 0;
75 const unsigned short OTHER_ERROR = 1;
76 const unsigned short BAD_REQUEST = 2;
77 const unsigned short CONFIGURATION_UNSUPPORTED = 3;
78 const unsigned short DEVICE_INELIGIBLE = 4;
79 const unsigned short TIMEOUT = 5;
82 undefined register (DOMString appId,
83 sequence<RegisterRequest> registerRequests,
84 sequence<RegisteredKey> registeredKeys,
85 U2FRegisterCallback callback,
86 optional long? opt_timeoutSeconds);
89 undefined sign (DOMString appId,
91 sequence<RegisteredKey> registeredKeys,
92 U2FSignCallback callback,
93 optional long? opt_timeoutSeconds);