diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 95b1e9114ab536..2605393878ef5d 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1379,6 +1379,9 @@ This can be called many times with new data as it is streamed. * `key` {Object | string | Buffer} - `key`: {string | Buffer} @@ -1843,6 +1853,12 @@ must be an object with the properties described above. If the format is `'pem'`, the `'key'` may also be an X.509 certificate. +Because public keys can be derived from private keys, a private key may be +passed instead of a public key. In that case, this function behaves as if +[`crypto.createPrivateKey()`][] had been called, except that the type of the +returned `KeyObject` will be `public` and that the private key cannot be +extracted from the returned `KeyObject`. + ### crypto.createSecretKey(key)