mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:47:44 +00:00
LibWeb: Refactor SubtleCrypto to allow adding more algorithms easier
This patch throws away some of the spec suggestions for how to implement the normalize_algorithm AO and uses a new pattern that we can actually extend in our C++. Also update CryptoKey to store the key data.
This commit is contained in:
parent
644e764620
commit
2d59d6c98c
9 changed files with 294 additions and 136 deletions
|
@ -6,6 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibWeb/WebIDL/Buffers.h>
|
||||
|
||||
// FIXME: Generate these from IDL
|
||||
|
@ -40,11 +44,6 @@ struct JsonWebKey {
|
|||
Optional<String> k;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#dfn-Algorithm
|
||||
struct Algorithm {
|
||||
String name;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#key-algorithm-dictionary
|
||||
class KeyAlgorithm : public JS::Object {
|
||||
JS_OBJECT(KeyAlgorithm, Object);
|
||||
|
@ -66,11 +65,4 @@ private:
|
|||
String m_name;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#pbkdf2-params
|
||||
struct Pbkdf2Params {
|
||||
JS::Handle<WebIDL::BufferSource> salt;
|
||||
u32 iterations;
|
||||
Variant<JS::Handle<JS::Object>, String> hash;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue