LibWeb: Implement AES-CTR.importKey

This commit is contained in:
stelar7 2024-10-30 22:44:20 +01:00 committed by Andreas Kling
parent 21a32e4b6d
commit 0864436383
Notes: github-actions[bot] 2024-10-31 07:16:24 +00:00
3 changed files with 137 additions and 0 deletions

View file

@ -327,6 +327,19 @@ private:
}
};
class AesCtr : public AlgorithmMethods {
public:
virtual WebIDL::ExceptionOr<JS::NonnullGCPtr<CryptoKey>> import_key(AlgorithmParams const&, Bindings::KeyFormat, CryptoKey::InternalKeyData, bool, Vector<Bindings::KeyUsage> const&) override;
static NonnullOwnPtr<AlgorithmMethods> create(JS::Realm& realm) { return adopt_own(*new AesCtr(realm)); }
private:
explicit AesCtr(JS::Realm& realm)
: AlgorithmMethods(realm)
{
}
};
class HKDF : public AlgorithmMethods {
public:
virtual WebIDL::ExceptionOr<JS::NonnullGCPtr<CryptoKey>> import_key(AlgorithmParams const&, Bindings::KeyFormat, CryptoKey::InternalKeyData, bool, Vector<Bindings::KeyUsage> const&) override;