Skip to content

Commit 198b6e0

Browse files
panvaaduh95
authored andcommitted
doc: deprecate CryptoKey use in node:crypto
Refs: #55293 PR-URL: #62321 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ffcc5a5 commit 198b6e0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

doc/api/deprecations.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4461,6 +4461,42 @@ const server = http2.createSecureServer({
44614461
});
44624462
```
44634463
4464+
### DEP0203: Passing `CryptoKey` to `node:crypto` APIs
4465+
4466+
<!-- YAML
4467+
changes:
4468+
- version: REPLACEME
4469+
pr-url: https://github.com/nodejs/node/pull/62321
4470+
description: Documentation-only deprecation.
4471+
-->
4472+
4473+
Type: Documentation-only
4474+
4475+
Passing a [`CryptoKey`][] to `node:crypto` functions is deprecated and
4476+
will throw an error in a future version. This includes
4477+
[`crypto.createPublicKey()`][], [`crypto.createPrivateKey()`][],
4478+
[`crypto.sign()`][], [`crypto.verify()`][],
4479+
[`crypto.publicEncrypt()`][], [`crypto.publicDecrypt()`][],
4480+
[`crypto.privateEncrypt()`][], [`crypto.privateDecrypt()`][],
4481+
[`Sign.prototype.sign()`][], [`Verify.prototype.verify()`][],
4482+
[`crypto.createHmac()`][], [`crypto.createCipheriv()`][],
4483+
[`crypto.createDecipheriv()`][], [`crypto.encapsulate()`][], and
4484+
[`crypto.decapsulate()`][].
4485+
4486+
### DEP0204: `KeyObject.from()` with non-extractable `CryptoKey`
4487+
4488+
<!-- YAML
4489+
changes:
4490+
- version: REPLACEME
4491+
pr-url: https://github.com/nodejs/node/pull/62321
4492+
description: Documentation-only deprecation.
4493+
-->
4494+
4495+
Type: Documentation-only
4496+
4497+
Passing a non-extractable [`CryptoKey`][] to [`KeyObject.from()`][] is
4498+
deprecated and will throw an error in a future version.
4499+
44644500
[DEP0142]: #dep0142-repl_builtinlibs
44654501
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
44664502
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4478,14 +4514,18 @@ const server = http2.createSecureServer({
44784514
[`Buffer.from(buffer)`]: buffer.md#static-method-bufferfrombuffer
44794515
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
44804516
[`Cipheriv`]: crypto.md#class-cipheriv
4517+
[`CryptoKey`]: webcrypto.md#class-cryptokey
44814518
[`Decipheriv`]: crypto.md#class-decipheriv
44824519
[`Duplex.toWeb()`]: stream.md#streamduplextowebstreamduplex-options
44834520
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
4521+
[`KeyObject.from()`]: crypto.md#static-method-keyobjectfromkey
44844522
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
44854523
[`ReadStream.open()`]: fs.md#class-fsreadstream
44864524
[`Server.getConnections()`]: net.md#servergetconnectionscallback
44874525
[`Server.listen({fd: <number>})`]: net.md#serverlistenhandle-backlog-callback
4526+
[`Sign.prototype.sign()`]: crypto.md#signsignprivatekey-outputencoding
44884527
[`String.prototype.toWellFormed`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toWellFormed
4528+
[`Verify.prototype.verify()`]: crypto.md#verifyverifyobject-signature-signatureencoding
44894529
[`WriteStream.open()`]: fs.md#class-fswritestream
44904530
[`assert`]: assert.md
44914531
[`asyncResource.runInAsyncScope()`]: async_context.md#asyncresourceruninasyncscopefn-thisarg-args
@@ -4503,11 +4543,21 @@ const server = http2.createSecureServer({
45034543
[`crypto.createDecipheriv()`]: crypto.md#cryptocreatedecipherivalgorithm-key-iv-options
45044544
[`crypto.createHash()`]: crypto.md#cryptocreatehashalgorithm-options
45054545
[`crypto.createHmac()`]: crypto.md#cryptocreatehmacalgorithm-key-options
4546+
[`crypto.createPrivateKey()`]: crypto.md#cryptocreateprivatekeykey
4547+
[`crypto.createPublicKey()`]: crypto.md#cryptocreatepublickeykey
4548+
[`crypto.decapsulate()`]: crypto.md#cryptodecapsulatekey-ciphertext-callback
4549+
[`crypto.encapsulate()`]: crypto.md#cryptoencapsulatekey-callback
45064550
[`crypto.fips`]: crypto.md#cryptofips
45074551
[`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback
4552+
[`crypto.privateDecrypt()`]: crypto.md#cryptoprivatedecryptprivatekey-buffer
4553+
[`crypto.privateEncrypt()`]: crypto.md#cryptoprivateencryptprivatekey-buffer
4554+
[`crypto.publicDecrypt()`]: crypto.md#cryptopublicdecryptkey-buffer
4555+
[`crypto.publicEncrypt()`]: crypto.md#cryptopublicencryptkey-buffer
45084556
[`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback
45094557
[`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback
45104558
[`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags
4559+
[`crypto.sign()`]: crypto.md#cryptosignalgorithm-data-key-callback
4560+
[`crypto.verify()`]: crypto.md#cryptoverifyalgorithm-data-key-signature-callback
45114561
[`decipher.final()`]: crypto.md#decipherfinaloutputencoding
45124562
[`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding
45134563
[`dirent.parentPath`]: fs.md#direntparentpath

0 commit comments

Comments
 (0)