mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Update the Key Usage enum to adapt for PostQuantum Algorithms
This commit is contained in:
parent
b0c48b961e
commit
1d6a64b26c
Notes:
github-actions[bot]
2025-11-27 20:51:29 +00:00
Author: https://github.com/tete17
Commit: 1d6a64b26c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6961
Reviewed-by: https://github.com/gmta ✅
3 changed files with 11 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
enum KeyType { "public", "private", "secret" };
|
enum KeyType { "public", "private", "secret" };
|
||||||
|
|
||||||
enum KeyUsage { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey" };
|
// https://wicg.github.io/webcrypto-modern-algos/#subtlecrypto-interface-keyusage
|
||||||
|
enum KeyUsage { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey", "encapsulateKey", "encapsulateBits", "decapsulateKey", "decapsulateBits" };
|
||||||
|
|
||||||
// https://w3c.github.io/webcrypto/#cryptokey-interface
|
// https://w3c.github.io/webcrypto/#cryptokey-interface
|
||||||
[SecureContext,Exposed=(Window,Worker),Serializable]
|
[SecureContext,Exposed=(Window,Worker),Serializable]
|
||||||
|
|
|
||||||
|
|
@ -365,7 +365,13 @@ JS::ThrowCompletionOr<GC::Ref<WebIDL::Promise>> SubtleCrypto::import_key(Binding
|
||||||
|
|
||||||
Variant<ByteBuffer, Bindings::JsonWebKey, Empty> real_key_data;
|
Variant<ByteBuffer, Bindings::JsonWebKey, Empty> real_key_data;
|
||||||
// 2. If format is equal to the string "raw", "pkcs8", or "spki":
|
// 2. If format is equal to the string "raw", "pkcs8", or "spki":
|
||||||
if (format == Bindings::KeyFormat::Raw || format == Bindings::KeyFormat::Pkcs8 || format == Bindings::KeyFormat::Spki) {
|
if (format == Bindings::KeyFormat::Raw
|
||||||
|
|| format == Bindings::KeyFormat::RawPublic
|
||||||
|
|| format == Bindings::KeyFormat::RawPrivate
|
||||||
|
|| format == Bindings::KeyFormat::RawSeed
|
||||||
|
|| format == Bindings::KeyFormat::RawSecret
|
||||||
|
|| format == Bindings::KeyFormat::Pkcs8
|
||||||
|
|| format == Bindings::KeyFormat::Spki) {
|
||||||
// 1. If the keyData parameter passed to the importKey() method is a JsonWebKey dictionary, throw a TypeError.
|
// 1. If the keyData parameter passed to the importKey() method is a JsonWebKey dictionary, throw a TypeError.
|
||||||
if (key_data.has<Bindings::JsonWebKey>()) {
|
if (key_data.has<Bindings::JsonWebKey>()) {
|
||||||
return realm.vm().throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "BufferSource");
|
return realm.vm().throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "BufferSource");
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ dictionary Algorithm {
|
||||||
required DOMString name;
|
required DOMString name;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum KeyFormat { "raw", "spki", "pkcs8", "jwk" };
|
// https://wicg.github.io/webcrypto-modern-algos/#subtlecrypto-interface-keyformat
|
||||||
|
enum KeyFormat { "raw-public", "raw-private", "raw-seed", "raw-secret", "raw", "spki", "pkcs8", "jwk" };
|
||||||
|
|
||||||
dictionary RsaOtherPrimesInfo {
|
dictionary RsaOtherPrimesInfo {
|
||||||
// The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms
|
// The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue