mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
The specification of Modern Algorithms in the Web Cryptography API (https://wicg.github.io/webcrypto-modern-algos/) adds new key formats and key usages to support modern cryptographic algorithms. This patch adds those new key formats and key usages, preparing for the implementation of the new algorithms. Testing: No behavioral changes in existing cryptographic algorithms. Existing tests suffice. Fixes: Part of #40687 --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
// https://w3c.github.io/webcrypto/#cryptokey-interface
|
|
|
|
enum KeyType { "public", "private", "secret" };
|
|
|
|
// enum KeyUsage { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey" };
|
|
|
|
[SecureContext, Exposed=(Window,Worker), /*Serializable,*/ Pref="dom_crypto_subtle_enabled"]
|
|
interface CryptoKey {
|
|
readonly attribute KeyType type;
|
|
readonly attribute boolean extractable;
|
|
readonly attribute object algorithm;
|
|
readonly attribute object usages;
|
|
};
|
|
|
|
// https://w3c.github.io/webcrypto/#keypair
|
|
|
|
dictionary CryptoKeyPair {
|
|
CryptoKey publicKey;
|
|
CryptoKey privateKey;
|
|
};
|
|
|
|
// https://wicg.github.io/webcrypto-modern-algos/#subtlecrypto-interface-keyusage
|
|
|
|
enum KeyUsage { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey", "encapsulateKey", "encapsulateBits", "decapsulateKey", "decapsulateBits" };
|