/* * Copyright (c) 2023, stelar7 * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include // FIXME: Generate these from IDL namespace Web::Bindings { // https://w3c.github.io/webcrypto/#JsonWebKey-dictionary struct RsaOtherPrimesInfo { Optional r; Optional d; Optional t; }; // https://w3c.github.io/webcrypto/#JsonWebKey-dictionary struct JsonWebKey { Optional kty; Optional use; Optional> key_ops; Optional alg; Optional ext; Optional crv; Optional x; Optional y; Optional d; Optional n; Optional e; Optional p; Optional q; Optional dp; Optional dq; Optional qi; Optional> oth; Optional 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); JS_DECLARE_ALLOCATOR(KeyAlgorithm); public: static JS::NonnullGCPtr create(JS::Realm&); virtual ~KeyAlgorithm() override = default; String const& name() const { return m_name; } void set_name(String name) { m_name = move(name); } private: KeyAlgorithm(JS::Realm&); virtual void initialize(JS::Realm&) override; JS_DECLARE_NATIVE_FUNCTION(name_getter); String m_name; }; // https://w3c.github.io/webcrypto/#pbkdf2-params struct Pbkdf2Params { JS::Handle salt; u32 iterations; Variant, String> hash; }; };