Skip to content

Commit

Permalink
doc: deprecate (doc-only) crypto.Certificate()
Browse files Browse the repository at this point in the history
Documentation-only: Recommend people use the static methods on
crypto.Certificate() and not the legacy API constructor.

PR-URL: #34697
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
Trott authored and BethGriggs committed Aug 20, 2020
1 parent 3bfe199 commit 47f2f45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ console.log(Certificate.verifySpkac(Buffer.from(spkac)));

### Legacy API

As a still supported legacy interface, it is possible to create new instances of
> Stability: 0 - Deprecated
As a legacy interface, it is possible to create new instances of
the `crypto.Certificate` class as illustrated in the examples below.

#### `new crypto.Certificate()`
Expand Down
16 changes: 16 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,20 @@ Type: Documentation-only

[`socket.bufferSize`][] is just an alias for [`writable.writableLength`][].

<a id="DEP0XXX"></a>
### DEP0XXX: `new crypto.Certificate()`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/34697
description: Documentation-only deprecation.
-->

Type: Documentation-only

The [`crypto.Certificate()` constructor][] is deprecated. Use
[static methods of `crypto.Certificate()`][] instead.

[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_static_method_buffer_allocunsafeslow_size
Expand All @@ -2776,6 +2790,7 @@ Type: Documentation-only
[`clearTimeout()`]: timers.html#timers_cleartimeout_timeout
[`console.error()`]: console.html#console_console_error_data_args
[`console.log()`]: console.html#console_console_log_data_args
[`crypto.Certificate()` constructor]: crypto.html#crypto_legacy_api
[`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding
[`crypto.createCipher()`]: crypto.html#crypto_crypto_createcipher_algorithm_password_options
[`crypto.createCipheriv()`]: crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options
Expand Down Expand Up @@ -2875,3 +2890,4 @@ Type: Documentation-only
[from_arraybuffer]: buffer.html#buffer_static_method_buffer_from_arraybuffer_byteoffset_length
[from_string_encoding]: buffer.html#buffer_static_method_buffer_from_string_encoding
[legacy `urlObject`]: url.html#url_legacy_urlobject
[static methods of `crypto.Certificate()`]: crypto.html#crypto_class_certificate

0 comments on commit 47f2f45

Please sign in to comment.