mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
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.
This commit is contained in:
parent
ce6c515873
commit
615be9eb7c
8 changed files with 57 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue