Skip to content

Commit 89d1de2

Browse files
vicbelithrar
authored andcommitted
fix node:crypto API support (#17952)
1 parent 1e021cc commit 89d1de2

File tree

1 file changed

+45
-46
lines changed
  • src/content/docs/workers/runtime-apis/nodejs

1 file changed

+45
-46
lines changed
Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
pcx_content_type: configuration
33
title: Crypto
4-
54
---
65

7-
import { Render } from "~/components"
6+
import { Render } from "~/components";
87

98
<Render file="nodejs-compat-howto" />
109

@@ -18,28 +17,28 @@ The [WebCrypto API](/workers/runtime-apis/web-crypto/) is also available within
1817

1918
| API | Supported? | Notes |
2019
| --------------------------------------------------------------------------------- | ---------- | ----- |
21-
| [Certificate](https://nodejs.org/api/crypto.html#class-certificate) | | |
20+
| [Certificate](https://nodejs.org/api/crypto.html#class-certificate) || |
2221
| [Cipher](https://nodejs.org/api/crypto.html#class-cipher) | | |
2322
| [Decipher](https://nodejs.org/api/crypto.html#class-decipher) | | |
24-
| [DiffieHellman](https://nodejs.org/api/crypto.html#class-diffiehellman) | | |
25-
| [DiffieHellmanGroup](https://nodejs.org/api/crypto.html#class-diffiehellmangroup) | | |
23+
| [DiffieHellman](https://nodejs.org/api/crypto.html#class-diffiehellman) || |
24+
| [DiffieHellmanGroup](https://nodejs.org/api/crypto.html#class-diffiehellmangroup) || |
2625
| [ECDH](https://nodejs.org/api/crypto.html#class-ecdh) | | |
27-
| [Hash](https://nodejs.org/api/crypto.html#class-hash) | | |
28-
| [Hmac](https://nodejs.org/api/crypto.html#class-hmac) | | |
26+
| [Hash](https://nodejs.org/api/crypto.html#class-hash) || |
27+
| [Hmac](https://nodejs.org/api/crypto.html#class-hmac) || |
2928
| [KeyObject](https://nodejs.org/api/crypto.html#class-keyobject) | | |
3029
| [Sign](https://nodejs.org/api/crypto.html#class-sign) | | |
3130
| [Verify](https://nodejs.org/api/crypto.html#class-verify) | | |
32-
| [X509Certificate](https://nodejs.org/api/crypto.html#class-x509certificate) | | |
31+
| [X509Certificate](https://nodejs.org/api/crypto.html#class-x509certificate) || |
3332
| [constants](https://nodejs.org/api/crypto.html#cryptoconstants) | | |
3433

3534
## Primes
3635

3736
| API | Supported? | Notes |
3837
| -------------------------------------------------------------------------------------------- | ---------- | ----- |
39-
| [checkPrime](https://nodejs.org/api/crypto.html#cryptocheckprimecandidate-options-callback) | | |
40-
| [checkPrimeSync](https://nodejs.org/api/crypto.html#cryptocheckprimesynccandidate-options) | | |
41-
| [generatePrime](https://nodejs.org/api/crypto.html#cryptogenerateprimesize-options-callback) | | |
42-
| [generatePrimeSync](https://nodejs.org/api/crypto.html#cryptogenerateprimesyncsize-options) | | |
38+
| [checkPrime](https://nodejs.org/api/crypto.html#cryptocheckprimecandidate-options-callback) || |
39+
| [checkPrimeSync](https://nodejs.org/api/crypto.html#cryptocheckprimesynccandidate-options) || |
40+
| [generatePrime](https://nodejs.org/api/crypto.html#cryptogenerateprimesize-options-callback) || |
41+
| [generatePrimeSync](https://nodejs.org/api/crypto.html#cryptogenerateprimesyncsize-options) || |
4342

4443
## Ciphers
4544

@@ -58,32 +57,32 @@ The [WebCrypto API](/workers/runtime-apis/web-crypto/) is also available within
5857

5958
| API | Supported? | Notes |
6059
| ----------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ----- |
61-
| [createDiffieHellman(prime)](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding) | | |
62-
| [createDiffieHellman(primeLength)](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmanprimelength-generator) | | |
63-
| [createDiffieHellmanGroup](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmangroupname) | | |
60+
| [createDiffieHellman(prime)](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding) || |
61+
| [createDiffieHellman(primeLength)](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmanprimelength-generator) || |
62+
| [createDiffieHellmanGroup](https://nodejs.org/api/crypto.html#cryptocreatediffiehellmangroupname) || |
6463
| [createECDH](https://nodejs.org/api/crypto.html#cryptocreateecdhcurvename) | | |
6564
| [diffieHellman](https://nodejs.org/api/crypto.html#cryptodiffiehellmanoptions) | | |
66-
| [getDiffieHellman](https://nodejs.org/api/crypto.html#cryptogetdiffiehellmangroupname) | | |
65+
| [getDiffieHellman](https://nodejs.org/api/crypto.html#cryptogetdiffiehellmangroupname) || |
6766

6867
## Hash
6968

7069
| API | Supported? | Notes |
7170
| -------------------------------------------------------------------------------------- | ---------- | ----- |
72-
| [createHash](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options) | | |
73-
| [createHmac](https://nodejs.org/api/crypto.html#cryptocreatehmacalgorithm-key-options) | | |
74-
| [getHashes](https://nodejs.org/api/crypto.html#cryptogethashes) | | |
71+
| [createHash](https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-options) || |
72+
| [createHmac](https://nodejs.org/api/crypto.html#cryptocreatehmacalgorithm-key-options) || |
73+
| [getHashes](https://nodejs.org/api/crypto.html#cryptogethashes) || |
7574

7675
## Keys
7776

7877
| API | Supported? | Notes |
7978
| ------------------------------------------------------------------------------------------------ | ---------- | ----- |
8079
| [createPrivateKey](https://nodejs.org/api/crypto.html#cryptocreateprivatekeykey) | | |
8180
| [createPublicKey](https://nodejs.org/api/crypto.html#cryptocreatepublickeykey) | | |
82-
| [createSecretKey](https://nodejs.org/api/crypto.html#cryptocreatesecretkeykey-encoding) | | |
83-
| [generateKey](https://nodejs.org/api/crypto.html#cryptogeneratekeytype-options-callback) | | |
84-
| [generateKeyPair](https://nodejs.org/api/crypto.html#cryptogeneratekeypairtype-options-callback) | | |
85-
| [generateKeyPairSync](https://nodejs.org/api/crypto.html#cryptogeneratekeypairsynctype-options) | | |
86-
| [generateKeySync](https://nodejs.org/api/crypto.html#cryptogeneratekeysynctype-options) | | |
81+
| [createSecretKey](https://nodejs.org/api/crypto.html#cryptocreatesecretkeykey-encoding) | | |
82+
| [generateKey](https://nodejs.org/api/crypto.html#cryptogeneratekeytype-options-callback) | | |
83+
| [generateKeyPair](https://nodejs.org/api/crypto.html#cryptogeneratekeypairtype-options-callback) | | |
84+
| [generateKeyPairSync](https://nodejs.org/api/crypto.html#cryptogeneratekeypairsynctype-options) | | |
85+
| [generateKeySync](https://nodejs.org/api/crypto.html#cryptogeneratekeysynctype-options) | | |
8786

8887
## Sign/Verify
8988

@@ -99,45 +98,45 @@ The [WebCrypto API](/workers/runtime-apis/web-crypto/) is also available within
9998
| API | Supported? | Notes |
10099
| ---------------------------------------------------------------------------------------- | ---------- | ----- |
101100
| [getCipherInfo](https://nodejs.org/api/crypto.html#cryptogetcipherinfonameornid-options) | | |
102-
| [getCiphers](https://nodejs.org/api/crypto.html#cryptogetciphers) | | |
103-
| [getCurves](https://nodejs.org/api/crypto.html#cryptogetcurves) | | |
104-
| [secureHeapUsed](https://nodejs.org/api/crypto.html#cryptosecureheapused) | | |
105-
| [setEngine](https://nodejs.org/api/crypto.html#cryptosetengineengine-flags) | | |
106-
| [timingSafeEqual](https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b) | | |
101+
| [getCiphers](https://nodejs.org/api/crypto.html#cryptogetciphers) || |
102+
| [getCurves](https://nodejs.org/api/crypto.html#cryptogetcurves) || |
103+
| [secureHeapUsed](https://nodejs.org/api/crypto.html#cryptosecureheapused) || |
104+
| [setEngine](https://nodejs.org/api/crypto.html#cryptosetengineengine-flags) || |
105+
| [timingSafeEqual](https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b) || |
107106

108107
## Fips
109108

110109
| API | Supported? | Notes |
111110
| --------------------------------------------------------------- | ---------- | ----------------------------------- |
112-
| [getFips](https://nodejs.org/api/crypto.html#cryptogetfips) | | |
113-
| [fips](https://nodejs.org/api/crypto.html#cryptofips) | | Deprecated, use `getFips()` instead |
114-
| [setFips](https://nodejs.org/api/crypto.html#cryptosetfipsbool) | | |
111+
| [getFips](https://nodejs.org/api/crypto.html#cryptogetfips) || |
112+
| [fips](https://nodejs.org/api/crypto.html#cryptofips) || Deprecated, use `getFips()` instead |
113+
| [setFips](https://nodejs.org/api/crypto.html#cryptosetfipsbool) || |
115114

116115
## Random
117116

118117
| API | Supported? | Notes |
119118
| -------------------------------------------------------------------------------------------- | ---------- | ----- |
120-
| [getRandomValues](https://nodejs.org/api/crypto.html#cryptogetrandomvaluestypedarray) | | |
121-
| [randomBytes](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback) | | |
122-
| [randomFillSync](https://nodejs.org/api/crypto.html#cryptorandomfillsyncbuffer-offset-size) | | |
123-
| [randomFill](https://nodejs.org/api/crypto.html#cryptorandomfillbuffer-offset-size-callback) | | |
124-
| [randomInt](https://nodejs.org/api/crypto.html#cryptorandomintmin-max-callback) | | |
125-
| [randomUUID](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions) | | |
119+
| [getRandomValues](https://nodejs.org/api/crypto.html#cryptogetrandomvaluestypedarray) || |
120+
| [randomBytes](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback) || |
121+
| [randomFillSync](https://nodejs.org/api/crypto.html#cryptorandomfillsyncbuffer-offset-size) || |
122+
| [randomFill](https://nodejs.org/api/crypto.html#cryptorandomfillbuffer-offset-size-callback) || |
123+
| [randomInt](https://nodejs.org/api/crypto.html#cryptorandomintmin-max-callback) || |
124+
| [randomUUID](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions) || |
126125

127126
## Key Derivation
128127

129128
| API | Supported? | Notes |
130129
| ------------------------------------------------------------------------------------------------------------ | ---------- | ------------------------------ |
131-
| [hkdf](https://nodejs.org/api/crypto.html#cryptohkdfdigest-ikm-salt-info-keylen-callback) | | Does not yet support KeyObject |
132-
| [hkdfSync](https://nodejs.org/api/crypto.html#cryptohkdfsyncdigest-ikm-salt-info-keylen) | | Does not yet support KeyObject |
133-
| [pbkdf2](https://nodejs.org/api/crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback) | | |
134-
| [pbkdf2Sync](https://nodejs.org/api/crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback) | | |
135-
| [scrypt](https://nodejs.org/api/crypto.html#cryptoscryptpassword-salt-keylen-options-callback) | | |
136-
| [scryptSync](https://nodejs.org/api/crypto.html#cryptoscryptsyncpassword-salt-keylen-options) | | |
130+
| [hkdf](https://nodejs.org/api/crypto.html#cryptohkdfdigest-ikm-salt-info-keylen-callback) || Does not yet support KeyObject |
131+
| [hkdfSync](https://nodejs.org/api/crypto.html#cryptohkdfsyncdigest-ikm-salt-info-keylen) || Does not yet support KeyObject |
132+
| [pbkdf2](https://nodejs.org/api/crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback) || |
133+
| [pbkdf2Sync](https://nodejs.org/api/crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback) || |
134+
| [scrypt](https://nodejs.org/api/crypto.html#cryptoscryptpassword-salt-keylen-options-callback) || |
135+
| [scryptSync](https://nodejs.org/api/crypto.html#cryptoscryptsyncpassword-salt-keylen-options) || |
137136

138137
## WebCrypto
139138

140139
| API | Supported? | Notes |
141140
| --------------------------------------------------------- | ---------- | ----- |
142-
| [subtle](https://nodejs.org/api/crypto.html#cryptosubtle) | | |
143-
| [webcrypto](https://nodejs.org/api/crypto.html#) | | |
141+
| [subtle](https://nodejs.org/api/crypto.html#cryptosubtle) || |
142+
| [webcrypto](https://nodejs.org/api/crypto.html#) || |

0 commit comments

Comments
 (0)