ladybird/Userland/Libraries/LibWeb/Crypto/CryptoBindings.h
Andrew Kaster a9d240c647 LibWeb: Implement SubtleCrypto.generateKey for RSA-OAEP
This patch implements and tests window.crypto.sublte.generateKey with
an RSA-OAEP algorithm. In order for the types to be happy, the
KeyAlgorithms objects are moved to their own .h/.cpp pair, and the new
KeyAlgorithms for RSA are added there.
2024-03-13 15:31:00 -06:00

47 lines
1 KiB
C++

/*
* Copyright (c) 2023, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#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
namespace Web::Bindings {
// https://w3c.github.io/webcrypto/#JsonWebKey-dictionary
struct RsaOtherPrimesInfo {
Optional<String> r;
Optional<String> d;
Optional<String> t;
};
// https://w3c.github.io/webcrypto/#JsonWebKey-dictionary
struct JsonWebKey {
Optional<String> kty;
Optional<String> use;
Optional<Vector<String>> key_ops;
Optional<String> alg;
Optional<bool> ext;
Optional<String> crv;
Optional<String> x;
Optional<String> y;
Optional<String> d;
Optional<String> n;
Optional<String> e;
Optional<String> p;
Optional<String> q;
Optional<String> dp;
Optional<String> dq;
Optional<String> qi;
Optional<Vector<RsaOtherPrimesInfo>> oth;
Optional<String> k;
};
}