mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:07:36 +00:00
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.
This commit is contained in:
parent
008c89edde
commit
a9d240c647
12 changed files with 536 additions and 81 deletions
|
@ -44,25 +44,4 @@ struct JsonWebKey {
|
|||
Optional<String> k;
|
||||
};
|
||||
|
||||
// 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<KeyAlgorithm> 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;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue