| Index: modules/crypto/SubtleCrypto.idl
|
| diff --git a/modules/crypto/SubtleCrypto.idl b/modules/crypto/SubtleCrypto.idl
|
| index ff0718bf8ed6ff8b4acb38848d91004b35b359b2..da23af3e960fb7022cbd5fb1990017563ca5204e 100644
|
| --- a/modules/crypto/SubtleCrypto.idl
|
| +++ b/modules/crypto/SubtleCrypto.idl
|
| @@ -28,21 +28,43 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| +// http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface
|
| +
|
| +typedef DOMString KeyFormat;
|
| +typedef DOMString KeyUsage; // from Key interface
|
| +
|
| +// FIXME: use below; needs support for union types http://crbug.com/240176
|
| +typedef (ArrayBuffer or ArrayBufferView) CryptoOperationData;
|
| +
|
| [
|
| - WillBeGarbageCollected,
|
| - NoInterfaceObject
|
| + GarbageCollected,
|
| + NoInterfaceObject,
|
| ] interface SubtleCrypto {
|
| - [RaisesException] Promise encrypt(Dictionary algorithm, Key key, ArrayBufferView data);
|
| - [RaisesException] Promise decrypt(Dictionary algorithm, Key key, ArrayBufferView data);
|
| - [RaisesException] Promise sign(Dictionary algorithm, Key key, ArrayBufferView data);
|
| - [RaisesException, ImplementedAs=verifySignature] Promise verify(Dictionary algorithm, Key key, ArrayBufferView signature, ArrayBufferView data);
|
| - [RaisesException] Promise digest(Dictionary algorithm, ArrayBufferView data);
|
| -
|
| - [RaisesException] Promise generateKey(Dictionary algorithm, boolean extractable, DOMString[] keyUsages);
|
| - [RaisesException] Promise importKey(DOMString format, ArrayBufferView keyData, Dictionary? algorithm, boolean extractable, DOMString[] keyUsages);
|
| - [RaisesException] Promise exportKey(DOMString format, Key key);
|
| -
|
| - [RaisesException] Promise wrapKey(DOMString format, Key key, Key wrappingKey, Dictionary wrapAlgorithm);
|
| - [RaisesException] Promise unwrapKey(DOMString format, ArrayBufferView wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary? unwrappedKeyAlgorithm, boolean extractable, DOMString[] keyUsages);
|
| -};
|
| + [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayBuffer data);
|
| + [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayBufferView data);
|
| +
|
| + [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayBuffer data);
|
| + [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayBufferView data);
|
| +
|
| + [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBuffer data);
|
| + [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBufferView data);
|
| +
|
| + // FIXME: should be: Promise verify(Dictionary algorithm, Key key, CryptoOperationData signature, CryptoOperationData data);
|
| + [CallWith=ScriptState, Custom, ImplementedAs=verifySignature] Promise verify(Dictionary algorithm, Key key, object signature, object data);
|
|
|
| + [CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBuffer data);
|
| + [CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBufferView data);
|
| +
|
| + [CallWith=ScriptState] Promise generateKey(Dictionary algorithm, boolean extractable, DOMString[] keyUsages);
|
| +
|
| + [CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBuffer keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
|
| + [CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBufferView keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
|
| + [CallWith=ScriptState] Promise importKey(KeyFormat format, Dictionary keyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages);
|
| +
|
| + [CallWith=ScriptState] Promise exportKey(KeyFormat format, Key key);
|
| +
|
| + [CallWith=ScriptState] Promise wrapKey(KeyFormat format, Key key, Key wrappingKey, Dictionary wrapAlgorithm);
|
| +
|
| + [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBuffer wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
|
| + [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBufferView wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlgorithm, boolean extractable, KeyUsage[] keyUsages);
|
| +};
|
|
|