Skip to content

Commit 0d37af1

Browse files
committed
doc: deprecate CryptoKey use in node:crypto
Refs: #55293
1 parent 4d2d6de commit 0d37af1

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

doc/api/deprecations.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,6 +4481,40 @@ const server = http2.createSecureServer({
44814481
});
44824482
```
44834483
4484+
### DEP0203: Passing `CryptoKey` to `node:crypto` APIs
4485+
4486+
<!-- YAML
4487+
changes:
4488+
- version: REPLACEME
4489+
description: Documentation-only deprecation.
4490+
-->
4491+
4492+
Type: Documentation-only
4493+
4494+
Passing a [`CryptoKey`][] to `node:crypto` functions is deprecated and
4495+
will throw an error in a future version. This includes
4496+
[`crypto.createPublicKey()`][], [`crypto.createPrivateKey()`][],
4497+
[`crypto.sign()`][], [`crypto.verify()`][],
4498+
[`crypto.publicEncrypt()`][], [`crypto.publicDecrypt()`][],
4499+
[`crypto.privateEncrypt()`][], [`crypto.privateDecrypt()`][],
4500+
[`Sign.prototype.sign()`][], [`Verify.prototype.verify()`][],
4501+
[`crypto.createHmac()`][], [`crypto.createCipheriv()`][],
4502+
[`crypto.createDecipheriv()`][], [`crypto.encapsulate()`][], and
4503+
[`crypto.decapsulate()`][].
4504+
4505+
### DEP0204: `KeyObject.from()` with non-extractable `CryptoKey`
4506+
4507+
<!-- YAML
4508+
changes:
4509+
- version: REPLACEME
4510+
description: Documentation-only deprecation.
4511+
-->
4512+
4513+
Type: Documentation-only
4514+
4515+
Passing a non-extractable [`CryptoKey`][] to [`KeyObject.from()`][] is
4516+
deprecated and will throw an error in a future version.
4517+
44844518
[DEP0142]: #dep0142-repl_builtinlibs
44854519
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
44864520
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4518,19 +4552,36 @@ const server = http2.createSecureServer({
45184552
[`clearTimeout()`]: timers.md#cleartimeouttimeout
45194553
[`console.error()`]: console.md#consoleerrordata-args
45204554
[`console.log()`]: console.md#consolelogdata-args
4555+
[`CryptoKey`]: webcrypto.md#class-cryptokey
45214556
[`crypto.Certificate()` constructor]: crypto.md#legacy-api
45224557
[`crypto.createCipheriv()`]: crypto.md#cryptocreatecipherivalgorithm-key-iv-options
45234558
[`crypto.createDecipheriv()`]: crypto.md#cryptocreatedecipherivalgorithm-key-iv-options
45244559
[`crypto.createHash()`]: crypto.md#cryptocreatehashalgorithm-options
45254560
[`crypto.createHmac()`]: crypto.md#cryptocreatehmacalgorithm-key-options
4561+
[`crypto.createPrivateKey()`]: crypto.md#cryptocreateprivatekeykey
4562+
[`crypto.createPublicKey()`]: crypto.md#cryptocreatepublickeykey
4563+
[`crypto.decapsulate()`]: crypto.md#cryptodecapsulatekey-ciphertext-callback
4564+
[`crypto.encapsulate()`]: crypto.md#cryptoencapsulatekey-callback
45264565
[`crypto.fips`]: crypto.md#cryptofips
45274566
[`crypto.pbkdf2()`]: crypto.md#cryptopbkdf2password-salt-iterations-keylen-digest-callback
4567+
[`crypto.privateDecrypt()`]: crypto.md#cryptoprivatedecryptprivatekey-buffer
4568+
[`crypto.privateEncrypt()`]: crypto.md#cryptoprivateencryptprivatekey-buffer
4569+
[`crypto.publicDecrypt()`]: crypto.md#cryptopublicdecryptkey-buffer
4570+
[`crypto.publicEncrypt()`]: crypto.md#cryptopublicencryptkey-buffer
45284571
[`crypto.randomBytes()`]: crypto.md#cryptorandombytessize-callback
45294572
[`crypto.scrypt()`]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback
45304573
[`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags
4574+
[`crypto.sign()`]: crypto.md#cryptosignalgorithm-data-key-callback
4575+
[`crypto.verify()`]: crypto.md#cryptoverifyalgorithm-data-key-signature-callback
45314576
[`decipher.final()`]: crypto.md#decipherfinaloutputencoding
45324577
[`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding
45334578
[`dirent.parentPath`]: fs.md#direntparentpath
4579+
[KeyObject]: crypto.md#class-keyobject
4580+
[`KeyObject`]: crypto.md#class-keyobject
4581+
[`KeyObject.from()`]: crypto.md#static-method-keyobjectfromkey
4582+
[`Sign.prototype.sign()`]: crypto.md#signsignprivatekey-outputencoding
4583+
[`Verify.prototype.verify()`]: crypto.md#verifyverifyobject-signature-signatureencoding
4584+
[WebCrypto API]: webcrypto.md
45344585
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
45354586
[`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options
45364587
[`domain`]: domain.md

0 commit comments

Comments
 (0)