aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/CryptoKey.webidl
diff options
context:
space:
mode:
authorDaniel Adams <70986246+msub2@users.noreply.github.com>2024-10-08 03:51:08 +0000
committerGitHub <noreply@github.com>2024-10-08 03:51:08 +0000
commitfc0d4d8157c71c512817886bc3b8d1adad5d46a9 (patch)
tree0def1a423dd597400abee4906940d375c3b6ca6f /components/script/dom/webidls/CryptoKey.webidl
parent66bc430b24a0cb1fe2d51e2b5983ea8833ba22b9 (diff)
downloadservo-fc0d4d8157c71c512817886bc3b8d1adad5d46a9.tar.gz
servo-fc0d4d8157c71c512817886bc3b8d1adad5d46a9.zip
crypto: Begin SubtleCrypto implementation (#33628)
* Update IDLs and Bindings conf Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add AES crate Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement DOM interfaces Signed-off-by: Daniel Adams <msub2official@gmail.com> * IDL tidy Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove deriveKey from inRealms for now until implemented Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix CryptoKey rustdoc comments Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move string constants to top of file Signed-off-by: Daniel Adams <msub2official@gmail.com> * Use properly rooted CryptoKey Signed-off-by: Daniel Adams <msub2official@gmail.com> * Code clarity Signed-off-by: Daniel Adams <msub2official@gmail.com> * Rework NormalizedAlgorithm to not hold a DOMString Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add Rustdoc for CryptoKey interface Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move ignore mallocsizeof to rand crate, remove from crypto Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update cargo lock Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix key handling, implement exportKey with JWK TODO Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link Signed-off-by: Daniel Adams <msub2official@gmail.com> * Use create_buffer_source, remove aes dep from libservo Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix crash when running in worker Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move CryptoKey and SubtleCrypto behind pref for now Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Readd timeout expectation Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
Diffstat (limited to 'components/script/dom/webidls/CryptoKey.webidl')
-rw-r--r--components/script/dom/webidls/CryptoKey.webidl17
1 files changed, 17 insertions, 0 deletions
diff --git a/components/script/dom/webidls/CryptoKey.webidl b/components/script/dom/webidls/CryptoKey.webidl
new file mode 100644
index 00000000000..1cad0097df2
--- /dev/null
+++ b/components/script/dom/webidls/CryptoKey.webidl
@@ -0,0 +1,17 @@
+/* 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 https://mozilla.org/MPL/2.0/. */
+
+// https://w3c.github.io/webcrypto/#cryptokey-interface
+
+enum KeyType { "public", "private", "secret" };
+
+enum KeyUsage { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey" };
+
+[SecureContext, Exposed=(Window,Worker), Serializable, Pref="dom.crypto.subtle.enabled"]
+interface CryptoKey {
+ readonly attribute KeyType type;
+ readonly attribute boolean extractable;
+ readonly attribute object algorithm;
+ readonly attribute object usages;
+};