Skip to content

Commit 8a8e5c7

Browse files
jieyanhuangtargos
authored andcommitted
doc: add return values in crypto documentation
Clarify return values for crypto.publicEncrypt and similar functions PR-URL: #16229 Fixes: #12946 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 06bae4b commit 8a8e5c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/crypto.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,7 @@ added: v0.11.14
16331633
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
16341634
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
16351635
- `buffer` {Buffer | TypedArray | DataView}
1636+
- Returns: {Buffer} A new `Buffer` with the decrypted content.
16361637

16371638
Decrypts `buffer` with `privateKey`.
16381639

@@ -1650,6 +1651,7 @@ added: v1.1.0
16501651
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
16511652
`RSA_PKCS1_PADDING`.
16521653
- `buffer` {Buffer | TypedArray | DataView}
1654+
- Returns: {Buffer} A new `Buffer` with the encrypted content.
16531655

16541656
Encrypts `buffer` with `privateKey`.
16551657

@@ -1667,6 +1669,7 @@ added: v1.1.0
16671669
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
16681670
`RSA_PKCS1_PADDING`.
16691671
- `buffer` {Buffer | TypedArray | DataView}
1672+
- Returns: {Buffer} A new `Buffer` with the decrypted content.
16701673

16711674
Decrypts `buffer` with `publicKey`.
16721675

@@ -1687,6 +1690,7 @@ added: v0.11.14
16871690
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
16881691
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
16891692
- `buffer` {Buffer | TypedArray | DataView}
1693+
- Returns: {Buffer} A new `Buffer` with the encrypted content.
16901694

16911695
Encrypts the content of `buffer` with `publicKey` and returns a new
16921696
[`Buffer`][] with encrypted content.

0 commit comments

Comments
 (0)