# HG changeset patch # User Yaroslav Zhuravlev # Date 1685635938 -3600 # Node ID 2b161541806a07282ee21b3598f0c1817565c988 # Parent 19d3277e4793c467a0e2b554d6ad782b98ccb805 Documented the CryptoKey object in njs Reference. diff -r 19d3277e4793 -r 2b161541806a xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml Thu Jun 01 17:12:18 2023 +0100 +++ b/xml/en/docs/njs/reference.xml Thu Jun 01 17:12:18 2023 +0100 @@ -9,7 +9,7 @@
+ rev="108">
@@ -1518,7 +1518,7 @@ key -a CryptoKey that contains +a CryptoKey that contains the key to be used for encryption @@ -1698,7 +1698,7 @@ key -a CryptoKey +a CryptoKey that contains the key to be used for decryption. If RSA-OAEP is used, this is the privateKey property of the @@ -1822,11 +1822,11 @@ baseKey -is a CryptoKey +is a CryptoKey that represents the input to the derivation algorithm - the initial key material for the derivation function: for example, for PBKDF2 it might be a password, -imported as a CryptoKey using +imported as a CryptoKey using сrypto.subtle.importKey() @@ -1944,11 +1944,11 @@ baseKey -is a CryptoKey +is a CryptoKey that represents the input to the derivation algorithm - the initial key material for the derivation function: for example, for PBKDF2 it might be a password, -imported as a CryptoKey using +imported as a CryptoKey using сrypto.subtle.importKey(). @@ -2114,7 +2114,8 @@ сrypto.subtle.exportKey(format, key) -Exports a key: takes a key as a CryptoKey object +Exports a key: takes a key as +a CryptoKey object and returns the key in an external, portable format (since 0.7.10). If the format was jwk, @@ -2162,7 +2163,8 @@ key -the CryptoKey that contains the key to be exported +the CryptoKey +that contains the key to be exported @@ -2176,7 +2178,9 @@ or key pair for public-key algorithms (since 0.7.10). Returns a Promise that fulfills with the generated key -as a CryptoKey or CryptoKeyPair object. +as +a CryptoKey +or CryptoKeyPair object. Possible values: @@ -2339,9 +2343,9 @@ keyUsages) Imports a key: takes as input a key in an external, portable format -and gives a CryptoKey object. +and gives a CryptoKey object. Returns a Promise that fulfills with the imported key -as a CryptoKey object. +as a CryptoKey object. Possible values: @@ -2627,7 +2631,8 @@ key -is a CryptoKey object that the key to be used for signing. +is a CryptoKey object +that the key to be used for signing. If algorithm identifies a public-key cryptosystem, this is the private key. @@ -2719,7 +2724,8 @@ key -is a CryptoKey object that the key to be used for verifying. +is a CryptoKey object +that the key to be used for verifying. It is the secret key for a symmetric algorithm and the public key for a public-key system. @@ -2751,6 +2757,107 @@
+
+ + +The CryptoKey object +represents a cryptographic key obtained +from one of the SubtleCrypto methods: +сrypto.subtle.generateKey(), +сrypto.subtle.deriveKey(), +сrypto.subtle.importKey(). + + + + + +CryptoKey.algorithm + +returns an object describing the algorithm for which this key can be used +and any associated extra parameters +(since 0.8.0), +read-only + + +CryptoKey.extractable + +a boolean value, true if the key can be exported +(since 0.8.0), +read-only + + +CryptoKey.type + +a string value that indicates which kind of key is represented by the object, +read-only. +Possible values: + + +secret + +This key is a secret key for use with a symmetric algorithm. + + +private + +This key is the private half of an asymmetric algorithm's CryptoKeyPair. + + +public + +This key is the public half of an asymmetric algorithm's CryptoKeyPair. + + + + + +CryptoKey.usages + +An array of strings indicating what this key can be used for +(since 0.8.0), +read-only. +Possible array values: + + +encrypt + +key for encrypting messages + + +decrypt + +key for decrypting messages + + +sign + +key for signing messages + + +verify + +key for verifying signatures + + +deriveKey + +key for deriving a new key + + +deriveBits + +key for deriving bits + + + + + + + + +
+ +