mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-21 18:42:53 +00:00
LibWeb: Define EcKeyImportParams
This commit is contained in:
parent
6cf89e46c9
commit
fd336ed619
Notes:
github-actions[bot]
2024-11-27 10:01:21 +00:00
Author: https://github.com/devgianlu
Commit: fd336ed619
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2598
Reviewed-by: https://github.com/stelar7
2 changed files with 29 additions and 0 deletions
|
@ -609,6 +609,21 @@ JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> EcdhKeyDerivePrams::from_v
|
|||
return adopt_own<AlgorithmParams>(*new EcdhKeyDerivePrams { name, key });
|
||||
}
|
||||
|
||||
EcKeyImportParams::~EcKeyImportParams() = default;
|
||||
|
||||
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> EcKeyImportParams::from_value(JS::VM& vm, JS::Value value)
|
||||
{
|
||||
auto& object = value.as_object();
|
||||
|
||||
auto name_value = TRY(object.get("name"));
|
||||
auto name = TRY(name_value.to_string(vm));
|
||||
|
||||
auto named_curve_value = TRY(object.get("namedCurve"));
|
||||
auto named_curve = TRY(named_curve_value.to_string(vm));
|
||||
|
||||
return adopt_own<AlgorithmParams>(*new EcKeyImportParams { name, named_curve });
|
||||
}
|
||||
|
||||
HmacImportParams::~HmacImportParams() = default;
|
||||
|
||||
JS::ThrowCompletionOr<NonnullOwnPtr<AlgorithmParams>> HmacImportParams::from_value(JS::VM& vm, JS::Value value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue