summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-12-13 20:48:27 +0000
committerAndreas Kling <kling@serenityos.org>2021-12-14 09:01:06 +0100
commit615be9eb7ca88b20a13021cdf3eaf058c9059599 (patch)
tree03850ea8c22d72e09dc03f2e7ece2b8b7aaaa79a /Userland/Libraries/LibWeb/Crypto/Crypto.cpp
parentce6c515873072c4a51fe5cbc02755e9de7bbe952 (diff)
downloadserenity-615be9eb7ca88b20a13021cdf3eaf058c9059599.zip
LibWeb: Add the SubtleCrypto interface
Just some boilerplate code to get started :^) This adds both the SubtleCrypto constructor to the window object, as well as the crypto.subtle instance attribute.
Diffstat (limited to 'Userland/Libraries/LibWeb/Crypto/Crypto.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Crypto/Crypto.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
index 64ba54f6ed..020f10c0d8 100644
--- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
+++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
@@ -8,9 +8,15 @@
#include <LibJS/Runtime/TypedArray.h>
#include <LibWeb/Bindings/Wrapper.h>
#include <LibWeb/Crypto/Crypto.h>
+#include <LibWeb/Crypto/SubtleCrypto.h>
namespace Web::Crypto {
+Crypto::Crypto()
+ : m_subtle(SubtleCrypto::create())
+{
+}
+
DOM::ExceptionOr<JS::Value> Crypto::get_random_values(JS::Value array) const
{
// 1. If array is not an Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array, then throw a TypeMismatchError and terminate the algorithm.