LibWeb: Implement X25519.generateKey

This commit is contained in:
stelar7
2024-10-26 20:12:09 +02:00
committed by Andreas Kling
parent 8c5e5adc8a
commit 944f00c489
Notes: github-actions[bot] 2024-10-31 08:53:45 +00:00
3 changed files with 74 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -439,6 +440,7 @@ private:
class X25519 : public AlgorithmMethods {
public:
virtual WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::ArrayBuffer>> derive_bits(AlgorithmParams const&, JS::NonnullGCPtr<CryptoKey>, Optional<u32>) override;
virtual WebIDL::ExceptionOr<Variant<JS::NonnullGCPtr<CryptoKey>, JS::NonnullGCPtr<CryptoKeyPair>>> generate_key(AlgorithmParams const&, bool, Vector<Bindings::KeyUsage> const&) override;
static NonnullOwnPtr<AlgorithmMethods> create(JS::Realm& realm) { return adopt_own(*new X25519(realm)); }