Skip to content

Commit 06e7657

Browse files
committed
doc: Update doc of publicEncrypt method
As per #12946 the crypto doc for publicEncrypt doesn't tell you whether the encryption happens in place or not.
1 parent 57a08e2 commit 06e7657

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/crypto.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`.
16371637
<!-- YAML
16381638
added: v1.1.0
16391639
-->
1640-
- `private_key` {Object | string}
1640+
- `public_key` {Object | string}
16411641
- `key` {string} A PEM encoded private key.
16421642
- `passphrase` {string} An optional passphrase for the private key.
16431643
- `padding` {crypto.constants} An optional padding value defined in
@@ -1657,15 +1657,16 @@ be passed instead of a public key.
16571657
<!-- YAML
16581658
added: v0.11.14
16591659
-->
1660-
- `private_key` {Object | string}
1660+
- `public_key` {Object | string}
16611661
- `key` {string} A PEM encoded private key.
16621662
- `passphrase` {string} An optional passphrase for the private key.
16631663
- `padding` {crypto.constants} An optional padding value defined in
16641664
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
16651665
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
16661666
- `buffer` {Buffer | TypedArray | DataView}
16671667

1668-
Encrypts `buffer` with `public_key`.
1668+
Encrypts the content of `buffer` with `public_key` and returns a new
1669+
[`Buffer`][] with encrypted content.
16691670

16701671
`public_key` can be an object or a string. If `public_key` is a string, it is
16711672
treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.

0 commit comments

Comments
 (0)