diff options
Diffstat (limited to 'chromium/chrome/browser/resources/cryptotoken/signhelper.js')
-rw-r--r-- | chromium/chrome/browser/resources/cryptotoken/signhelper.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/cryptotoken/signhelper.js b/chromium/chrome/browser/resources/cryptotoken/signhelper.js new file mode 100644 index 00000000000..8b846d447a1 --- /dev/null +++ b/chromium/chrome/browser/resources/cryptotoken/signhelper.js @@ -0,0 +1,46 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Provides a "bottom half" helper to assist with raw sign + * requests. + */ +'use strict'; + +/** + * A helper for sign requests. + * @extends {Closeable} + * @interface + */ +function SignHelper() {} + +/** + * Attempts to sign the provided challenges. + * @param {Array.<SignHelperChallenge>} challenges the new challenges to sign. + * @return {boolean} whether the challenges were successfully added. + */ +SignHelper.prototype.doSign = function(challenges) {}; + +/** Closes this helper. */ +SignHelper.prototype.close = function() {}; + +/** + * A factory for creating sign helpers. + * @interface + */ +function SignHelperFactory() {} + +/** + * Creates a new sign helper. + * @param {Countdown} timer Timer after whose expiration the caller is no longer + * interested in the result of a sign request. + * @param {function(number, boolean)} errorCb Called when a sign request fails + * with an error code and whether any gnubbies were found. + * @param {function(SignHelperChallenge, string, string=)} successCb Called with + * the signature produced by a successful sign request. + * @param {string=} opt_logMsgUrl A URL to post log messages to. + * @return {SignHelper} The newly created helper. + */ +SignHelperFactory.prototype.createHelper = + function(timer, errorCb, successCb, opt_logMsgUrl) {}; |