dom/webidl/Crypto.webidl
author Reuben Morais <reuben.morais@gmail.com>
Sun, 25 May 2014 15:31:11 -0300
changeset 192401 4136b65c1c4b1578631c18dfffff3cec2aa52b4e
parent 191558 7ea38414bb31b01471b1beebf149c3cb99023fb7
child 204438 e412c7e5d6cb4e36882f1bbc6dacace5641d0f40
permissions -rw-r--r--
Bug 952486 - Use CheckPermissions instead of Func for several interfaces. r=bz

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * The origin of this IDL file is
 * http://www.w3.org/TR/WebCryptoAPI/
 */

[NoInterfaceObject]
interface RandomSource {
  [Throws]
  ArrayBufferView getRandomValues(ArrayBufferView array);
};

Crypto implements RandomSource;

interface Crypto {
  [Pref="dom.webcrypto.enabled"]
  readonly attribute SubtleCrypto subtle;
};

#ifndef MOZ_DISABLE_CRYPTOLEGACY
[NoInterfaceObject]
interface CryptoLegacy {
  readonly attribute DOMString version;

  [SetterThrows]
  attribute boolean enableSmartCardEvents;

  [Throws,NewObject]
  CRMFObject? generateCRMFRequest(ByteString? reqDN,
                                  ByteString? regToken,
                                  ByteString? authenticator,
                                  ByteString? eaCert,
                                  ByteString? jsCallback,
                                  any... args);

  [Throws]
  DOMString importUserCertificates(DOMString nickname,
                                   DOMString cmmfResponse,
                                   boolean doForcedBackup);

  DOMString signText(DOMString stringToSign,
                     DOMString caOption,
                     ByteString... args);

  [Throws]
  void logout();
};

Crypto implements CryptoLegacy;
#endif // !MOZ_DISABLE_CRYPTOLEGACY