forked from google/u2f-ref-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnubbyfactory.js
More file actions
53 lines (47 loc) · 1.77 KB
/
gnubbyfactory.js
File metadata and controls
53 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2014 Google Inc. All rights reserved
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
/**
* @fileoverview Contains a factory interface for creating and opening gnubbies.
*/
'use strict';
/**
* A factory for creating and opening gnubbies.
* @interface
*/
function GnubbyFactory() {}
/**
* Enumerates gnubbies.
* @param {function(number, Array<GnubbyDeviceId>)} cb Enumerate callback
*/
GnubbyFactory.prototype.enumerate = function(cb) {
};
/** @typedef {function(number, Gnubby=)} */
var FactoryOpenCallback;
/**
* Creates a new gnubby object, and opens the gnubby with the given index.
* @param {GnubbyDeviceId} which The device to open.
* @param {boolean} forEnroll Whether this gnubby is being opened for enrolling.
* @param {FactoryOpenCallback} cb Called with result of opening the gnubby.
* @param {string=} opt_appIdHash The base64-encoded hash of the app id for
* which the gnubby being opened.
* @param {string=} opt_logMsgUrl The url to post log messages to.
*/
GnubbyFactory.prototype.openGnubby =
function(which, forEnroll, cb, opt_appIdHash, opt_logMsgUrl) {
};
/**
* Called during enrollment to check whether a gnubby known not to be enrolled
* is allowed to enroll in its present state. Upon completion of the check, the
* callback is called.
* @param {Gnubby} gnubby The not-enrolled gnubby.
* @param {string} appIdHash The base64-encoded hash of the app id for which
* the gnubby being enrolled.
* @param {FactoryOpenCallback} cb Called with the result of the prerequisite
* check. (A non-zero status indicates failure.)
*/
GnubbyFactory.prototype.notEnrolledPrerequisiteCheck =
function(gnubby, appIdHash, cb) {
};