comparison xml/en/docs/njs/reference.xml @ 2987:b70e9b806810

Documented CryptoKeyPair object in njs Reference.
author Yaroslav Zhuravlev <yar@nginx.com>
date Thu, 06 Jul 2023 12:29:20 +0100
parents 2b161541806a
children 8899986c3622
comparison
equal deleted inserted replaced
2986:2b161541806a 2987:b70e9b806810
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Reference" 9 <article name="Reference"
10 link="/en/docs/njs/reference.html" 10 link="/en/docs/njs/reference.html"
11 lang="en" 11 lang="en"
12 rev="108"> 12 rev="109">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 <link doc="index.xml">njs</link> provides objects, methods and properties 17 <link doc="index.xml">njs</link> provides objects, methods and properties
1700 <tag-desc> 1700 <tag-desc>
1701 a <link id="cryptokey"><literal>CryptoKey</literal></link> 1701 a <link id="cryptokey"><literal>CryptoKey</literal></link>
1702 that contains the key to be used for decryption. 1702 that contains the key to be used for decryption.
1703 If <literal>RSA-OAEP</literal> is used, this is the 1703 If <literal>RSA-OAEP</literal> is used, this is the
1704 <literal>privateKey</literal> property of the 1704 <literal>privateKey</literal> property of the
1705 <literal>CryptoKeyPair</literal> object. 1705 <link id="cryptokeypair"><literal>CryptoKeyPair</literal></link> object.
1706 </tag-desc> 1706 </tag-desc>
1707 1707
1708 <tag-name id="crypto_decrypt_data"><literal>data</literal></tag-name> 1708 <tag-name id="crypto_decrypt_data"><literal>data</literal></tag-name>
1709 <tag-desc> 1709 <tag-desc>
1710 an 1710 an
2178 or key pair for public-key algorithms 2178 or key pair for public-key algorithms
2179 (since <link doc="changes.xml" id="njs0.7.10">0.7.10</link>). 2179 (since <link doc="changes.xml" id="njs0.7.10">0.7.10</link>).
2180 Returns a <literal>Promise</literal> that fulfills with the generated key 2180 Returns a <literal>Promise</literal> that fulfills with the generated key
2181 as 2181 as
2182 a <link id="cryptokey"><literal>CryptoKey</literal></link> 2182 a <link id="cryptokey"><literal>CryptoKey</literal></link>
2183 or <literal>CryptoKeyPair</literal> object. 2183 or <link id="cryptokeypair"><literal>CryptoKeyPair</literal></link> object.
2184 Possible values: 2184 Possible values:
2185 <list type="tag"> 2185 <list type="tag">
2186 2186
2187 <tag-name id="crypto_generate_key_alg"><literal>algorithm</literal></tag-name> 2187 <tag-name id="crypto_generate_key_alg"><literal>algorithm</literal></tag-name>
2188 <tag-desc> 2188 <tag-desc>
2798 This key is a secret key for use with a symmetric algorithm. 2798 This key is a secret key for use with a symmetric algorithm.
2799 </tag-desc> 2799 </tag-desc>
2800 2800
2801 <tag-name><literal>private</literal></tag-name> 2801 <tag-name><literal>private</literal></tag-name>
2802 <tag-desc> 2802 <tag-desc>
2803 This key is the private half of an asymmetric algorithm's CryptoKeyPair. 2803 This key is the private half of an asymmetric algorithm's
2804 <link id="cryptokeypair"><literal>CryptoKeyPair</literal></link>
2804 </tag-desc> 2805 </tag-desc>
2805 2806
2806 <tag-name><literal>public</literal></tag-name> 2807 <tag-name><literal>public</literal></tag-name>
2807 <tag-desc> 2808 <tag-desc>
2808 This key is the public half of an asymmetric algorithm's CryptoKeyPair. 2809 This key is the public half of an asymmetric algorithm's
2810 <link id="cryptokeypair"><literal>CryptoKeyPair</literal></link>.
2809 </tag-desc> 2811 </tag-desc>
2810 2812
2811 </list> 2813 </list>
2812 </tag-desc> 2814 </tag-desc>
2813 2815
2848 <tag-desc> 2850 <tag-desc>
2849 key for deriving bits 2851 key for deriving bits
2850 </tag-desc> 2852 </tag-desc>
2851 2853
2852 </list> 2854 </list>
2855 </tag-desc>
2856
2857 </list>
2858 </para>
2859
2860 </section>
2861
2862
2863 <section id="cryptokeypair" name="CryptoKeyPair">
2864
2865 <para>
2866 The <literal>CryptoKeyPair</literal> is a dictionary object
2867 of the <link id="builtin_crypto">WebCrypto API</link>
2868 that represents an asymmetric key pair.
2869 </para>
2870
2871 <para>
2872 <list type="tag">
2873
2874 <tag-name id="cryptokeypair_privatekey"><literal>CryptoKeyPair.privateKey</literal></tag-name>
2875 <tag-desc>
2876 A <link id="cryptokey"><literal>CryptoKey</literal></link> object
2877 representing the private key.
2878 </tag-desc>
2879
2880 <tag-name id="cryptokeypair_publickey"><literal>CryptoKeyPair.publicKey</literal></tag-name>
2881 <tag-desc>
2882 A <link id="cryptokey"><literal>CryptoKey</literal></link> object
2883 representing the public key.
2853 </tag-desc> 2884 </tag-desc>
2854 2885
2855 </list> 2886 </list>
2856 </para> 2887 </para>
2857 2888