LibWeb: Implement the generateKey algorithm for X448

This commit is contained in:
Andreas Kling 2024-11-25 11:18:05 +01:00 committed by Andreas Kling
commit 5a8b0a2610
Notes: github-actions[bot] 2024-11-25 16:18:05 +00:00
4 changed files with 122 additions and 35 deletions

View file

@ -543,6 +543,22 @@ private:
}
};
class X448 : public AlgorithmMethods {
public:
// FIXME: virtual WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> derive_bits(AlgorithmParams const&, GC::Ref<CryptoKey>, Optional<u32>) override;
virtual WebIDL::ExceptionOr<Variant<GC::Ref<CryptoKey>, GC::Ref<CryptoKeyPair>>> generate_key(AlgorithmParams const&, bool, Vector<Bindings::KeyUsage> const&) override;
// FIXME: virtual WebIDL::ExceptionOr<GC::Ref<CryptoKey>> import_key(AlgorithmParams const&, Bindings::KeyFormat, CryptoKey::InternalKeyData, bool, Vector<Bindings::KeyUsage> const&) override;
// FIXME: virtual WebIDL::ExceptionOr<GC::Ref<JS::Object>> export_key(Bindings::KeyFormat, GC::Ref<CryptoKey>) override;
static NonnullOwnPtr<AlgorithmMethods> create(JS::Realm& realm) { return adopt_own(*new X448(realm)); }
private:
explicit X448(JS::Realm& realm)
: AlgorithmMethods(realm)
{
}
};
class HMAC : public AlgorithmMethods {
public:
virtual WebIDL::ExceptionOr<GC::Ref<JS::ArrayBuffer>> sign(AlgorithmParams const&, GC::Ref<CryptoKey>, ByteBuffer const&) override;