OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
| 31 // http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface |
| 32 |
| 33 typedef DOMString KeyFormat; |
| 34 typedef DOMString KeyUsage; // from Key interface |
| 35 |
| 36 // FIXME: use below; needs support for union types http://crbug.com/240176 |
| 37 typedef (ArrayBuffer or ArrayBufferView) CryptoOperationData; |
| 38 |
31 [ | 39 [ |
32 WillBeGarbageCollected, | 40 GarbageCollected, |
33 NoInterfaceObject | 41 NoInterfaceObject, |
34 ] interface SubtleCrypto { | 42 ] interface SubtleCrypto { |
35 [RaisesException] Promise encrypt(Dictionary algorithm, Key key, ArrayBuffer
View data); | 43 [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayB
uffer data); |
36 [RaisesException] Promise decrypt(Dictionary algorithm, Key key, ArrayBuffer
View data); | 44 [CallWith=ScriptState] Promise encrypt(Dictionary algorithm, Key key, ArrayB
ufferView data); |
37 [RaisesException] Promise sign(Dictionary algorithm, Key key, ArrayBufferVie
w data); | |
38 [RaisesException, ImplementedAs=verifySignature] Promise verify(Dictionary a
lgorithm, Key key, ArrayBufferView signature, ArrayBufferView data); | |
39 [RaisesException] Promise digest(Dictionary algorithm, ArrayBufferView data)
; | |
40 | 45 |
41 [RaisesException] Promise generateKey(Dictionary algorithm, boolean extracta
ble, DOMString[] keyUsages); | 46 [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayB
uffer data); |
42 [RaisesException] Promise importKey(DOMString format, ArrayBufferView keyDat
a, Dictionary? algorithm, boolean extractable, DOMString[] keyUsages); | 47 [CallWith=ScriptState] Promise decrypt(Dictionary algorithm, Key key, ArrayB
ufferView data); |
43 [RaisesException] Promise exportKey(DOMString format, Key key); | |
44 | 48 |
45 [RaisesException] Promise wrapKey(DOMString format, Key key, Key wrappingKey
, Dictionary wrapAlgorithm); | 49 [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBuff
er data); |
46 [RaisesException] Promise unwrapKey(DOMString format, ArrayBufferView wrappe
dKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary? unwrappedKeyAlg
orithm, boolean extractable, DOMString[] keyUsages); | 50 [CallWith=ScriptState] Promise sign(Dictionary algorithm, Key key, ArrayBuff
erView data); |
| 51 |
| 52 // FIXME: should be: Promise verify(Dictionary algorithm, Key key, CryptoOpe
rationData signature, CryptoOperationData data); |
| 53 [CallWith=ScriptState, Custom, ImplementedAs=verifySignature] Promise verify
(Dictionary algorithm, Key key, object signature, object data); |
| 54 |
| 55 [CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBuffer data
); |
| 56 [CallWith=ScriptState] Promise digest(Dictionary algorithm, ArrayBufferView
data); |
| 57 |
| 58 [CallWith=ScriptState] Promise generateKey(Dictionary algorithm, boolean ext
ractable, DOMString[] keyUsages); |
| 59 |
| 60 [CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBuffer keyDa
ta, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages); |
| 61 [CallWith=ScriptState] Promise importKey(KeyFormat format, ArrayBufferView k
eyData, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages); |
| 62 [CallWith=ScriptState] Promise importKey(KeyFormat format, Dictionary keyDat
a, Dictionary algorithm, boolean extractable, KeyUsage[] keyUsages); |
| 63 |
| 64 [CallWith=ScriptState] Promise exportKey(KeyFormat format, Key key); |
| 65 |
| 66 [CallWith=ScriptState] Promise wrapKey(KeyFormat format, Key key, Key wrappi
ngKey, Dictionary wrapAlgorithm); |
| 67 |
| 68 [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBuffer wrapp
edKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKeyAlg
orithm, boolean extractable, KeyUsage[] keyUsages); |
| 69 [CallWith=ScriptState] Promise unwrapKey(KeyFormat format, ArrayBufferView w
rappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary unwrappedKe
yAlgorithm, boolean extractable, KeyUsage[] keyUsages); |
47 }; | 70 }; |
48 | |
OLD | NEW |