| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -800,9 +800,9 @@ added: v24.7.0 | |||
| 800 | 800 | ||
| 801 | 801 | <!--lint disable maximum-line-length remark-lint--> | |
| 802 | 802 | ||
| 803 | - * `operation` {string} "encrypt", "decrypt", "sign", "verify", "digest", "generateKey", "deriveKey", "deriveBits", "importKey", "exportKey", "getPublicKey", "wrapKey", or "unwrapKey" | ||
| 803 | + * `operation` {string} "encrypt", "decrypt", "sign", "verify", "digest", "generateKey", "deriveKey", "deriveBits", "importKey", "exportKey", "getPublicKey", "wrapKey", "unwrapKey", "encapsulateBits", "encapsulateKey", "decapsulateBits", or "decapsulateKey" | ||
| 804 | 804 | * `algorithm` {string|Algorithm} | |
| 805 | - * `lengthOrAdditionalAlgorithm` {null|number|string|Algorithm|undefined} Depending on the operation this is either ignored, the value of the length argument when operation is "deriveBits", the algorithm of key to be derived when operation is "deriveKey", the algorithm of key to be exported before wrapping when operation is "wrapKey", or the algorithm of key to be imported after unwrapping when operation is "unwrapKey". **Default:** `null` when operation is "deriveBits", `undefined` otherwise. | ||
| 805 | + * `lengthOrAdditionalAlgorithm` {null|number|string|Algorithm|undefined} Depending on the operation this is either ignored, the value of the length argument when operation is "deriveBits", the algorithm of key to be derived when operation is "deriveKey", the algorithm of key to be exported before wrapping when operation is "wrapKey", the algorithm of key to be imported after unwrapping when operation is "unwrapKey", or the algorithm of key to be imported after en/decapsulating a key when operation is "encapsulateKey" or "decapsulateKey". **Default:** `null` when operation is "deriveBits", `undefined` otherwise. | ||
| 806 | 806 | * Returns: {boolean} Indicating whether the implementation supports the given operation | |
| 807 | 807 | ||
| 808 | 808 | <!--lint enable maximum-line-length remark-lint--> | |
@@ -811,6 +811,8 @@ Allows feature detection in Web Crypto API, | |||
| 811 | 811 | which can be used to detect whether a given algorithm identifier | |
| 812 | 812 | (including its parameters) is supported for the given operation. | |
| 813 | 813 | ||
| 814 | + See [Checking for runtime algorithm support][] for an example use of this method. | ||
| 815 | + | ||
| 814 | 816 | ### `subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)` | |
| 815 | 817 | ||
| 816 | 818 | <!-- YAML | |
@@ -824,6 +826,10 @@ added: v24.7.0 | |||
| 824 | 826 | * `ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer} | |
| 825 | 827 | * Returns: {Promise} Fulfills with {ArrayBuffer} upon success. | |
| 826 | 828 | ||
| 829 | + A message recipient uses their asymmetric private key to decrypt an | ||
| 830 | + "encapsulated key" (ciphertext), thereby recovering a temporary symmetric | ||
| 831 | + key (represented as {ArrayBuffer}) which is then used to decrypt a message. | ||
| 832 | + | ||
| 827 | 833 | The algorithms currently supported include: | |
| 828 | 834 | ||
| 829 | 835 | * `'ML-KEM-512'`[^modern-algos] | |
@@ -846,6 +852,10 @@ added: v24.7.0 | |||
| 846 | 852 | * `usages` {string\[]} See [Key usages][]. | |
| 847 | 853 | * Returns: {Promise} Fulfills with {CryptoKey} upon success. | |
| 848 | 854 | ||
| 855 | + A message recipient uses their asymmetric private key to decrypt an | ||
| 856 | + "encapsulated key" (ciphertext), thereby recovering a temporary symmetric | ||
| 857 | + key (represented as {CryptoKey}) which is then used to decrypt a message. | ||
| 858 | + | ||
| 849 | 859 | The algorithms currently supported include: | |
| 850 | 860 | ||
| 851 | 861 | * `'ML-KEM-512'`[^modern-algos] | |
@@ -1031,6 +1041,9 @@ added: v24.7.0 | |||
| 1031 | 1041 | * `encapsulationKey` {CryptoKey} | |
| 1032 | 1042 | * Returns: {Promise} Fulfills with {EncapsulatedBits} upon success. | |
| 1033 | 1043 | ||
| 1044 | + Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. | ||
| 1045 | + This encrypted key is the "encapsulated key" represented as {EncapsulatedBits}. | ||
| 1046 | + | ||
| 1034 | 1047 | The algorithms currently supported include: | |
| 1035 | 1048 | ||
| 1036 | 1049 | * `'ML-KEM-512'`[^modern-algos] | |
@@ -1052,6 +1065,9 @@ added: v24.7.0 | |||
| 1052 | 1065 | * `usages` {string\[]} See [Key usages][]. | |
| 1053 | 1066 | * Returns: {Promise} Fulfills with {EncapsulatedKey} upon success. | |
| 1054 | 1067 | ||
| 1068 | + Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. | ||
| 1069 | + This encrypted key is the "encapsulated key" represented as {EncapsulatedKey}. | ||
| 1070 | + | ||
| 1055 | 1071 | The algorithms currently supported include: | |
| 1056 | 1072 | ||
| 1057 | 1073 | * `'ML-KEM-512'`[^modern-algos] | |
@@ -2032,6 +2048,11 @@ added: v15.0.0 | |||
| 2032 | 2048 | added: v24.7.0 | |
| 2033 | 2049 | --> | |
| 2034 | 2050 | ||
| 2051 | + A temporary symmetric secret key (represented as {ArrayBuffer}) for message encryption | ||
| 2052 | + and the ciphertext (that can be transmitted to the message recipient along with the | ||
| 2053 | + message) encrypted by this shared key. The recipient uses their private key to determine | ||
| 2054 | + what the shared key is which then allows them to decrypt the message. | ||
| 2055 | + | ||
| 2035 | 2056 | #### `encapsulatedBits.ciphertext` | |
| 2036 | 2057 | ||
| 2037 | 2058 | <!-- YAML | |
@@ -2054,6 +2075,11 @@ added: v24.7.0 | |||
| 2054 | 2075 | added: v24.7.0 | |
| 2055 | 2076 | --> | |
| 2056 | 2077 | ||
| 2078 | + A temporary symmetric secret key (represented as {CryptoKey}) for message encryption | ||
| 2079 | + and the ciphertext (that can be transmitted to the message recipient along with the | ||
| 2080 | + message) encrypted by this shared key. The recipient uses their private key to determine | ||
| 2081 | + what the shared key is which then allows them to decrypt the message. | ||
| 2082 | + | ||
| 2057 | 2083 | #### `encapsulatedKey.ciphertext` | |
| 2058 | 2084 | ||
| 2059 | 2085 | <!-- YAML | |
@@ -2656,6 +2682,7 @@ The length (in bytes) of the random salt to use. | |||
| 2656 | 2682 | ||
| 2657 | 2683 | [^openssl35]: Requires OpenSSL >= 3.5 | |
| 2658 | 2684 | ||
| 2685 | + [Checking for runtime algorithm support]: #checking-for-runtime-algorithm-support | ||
| 2659 | 2686 | [JSON Web Key]: https://tools.ietf.org/html/rfc7517 | |
| 2660 | 2687 | [Key usages]: #cryptokeyusages | |
| 2661 | 2688 | [Modern Algorithms in the Web Cryptography API]: #modern-algorithms-in-the-web-cryptography-api | |
| Back | FazBrowse Home | New Git URL |
0 commit comments