LibWeb: Implement ECDSA.importKey and ECDSA.exportKey

Very similar implementation to ECDH. Fixes ~700 tests!
This commit is contained in:
devgianlu 2024-12-02 17:36:21 +01:00 committed by Andreas Kling
parent 940cdc7cf9
commit f0fbd50c66
Notes: github-actions[bot] 2024-12-03 12:21:58 +00:00
7 changed files with 1498 additions and 118 deletions

View file

@ -470,6 +470,8 @@ public:
virtual WebIDL::ExceptionOr<JS::Value> verify(AlgorithmParams const&, GC::Ref<CryptoKey>, ByteBuffer const&, ByteBuffer const&) override;
virtual WebIDL::ExceptionOr<Variant<GC::Ref<CryptoKey>, GC::Ref<CryptoKeyPair>>> generate_key(AlgorithmParams const&, bool, Vector<Bindings::KeyUsage> const&) override;
virtual WebIDL::ExceptionOr<GC::Ref<CryptoKey>> import_key(AlgorithmParams const&, Bindings::KeyFormat, CryptoKey::InternalKeyData, bool, Vector<Bindings::KeyUsage> const&) override;
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 ECDSA(realm)); }