@@ -1687,12 +1687,15 @@ added: v0.11.14
1687
1687
` crypto.constants ` , which may be: ` crypto.constants.RSA_NO_PADDING ` ,
1688
1688
` RSA_PKCS1_PADDING ` , or ` crypto.constants.RSA_PKCS1_OAEP_PADDING ` .
1689
1689
- ` buffer ` {Buffer | TypedArray | DataView}
1690
+ - Returns: {Buffer}
1690
1691
1691
1692
Decrypts ` buffer ` with ` privateKey ` .
1692
1693
1693
1694
` privateKey ` can be an object or a string. If ` privateKey ` is a string, it is
1694
1695
treated as the key with no passphrase and will use ` RSA_PKCS1_OAEP_PADDING ` .
1695
1696
1697
+ Returns a new ` Buffer ` with the decrypted content.
1698
+
1696
1699
### crypto.privateEncrypt(privateKey, buffer)
1697
1700
<!-- YAML
1698
1701
added: v1.1.0
@@ -1704,12 +1707,15 @@ added: v1.1.0
1704
1707
` crypto.constants ` , which may be: ` crypto.constants.RSA_NO_PADDING ` or
1705
1708
` RSA_PKCS1_PADDING ` .
1706
1709
- ` buffer ` {Buffer | TypedArray | DataView}
1710
+ - Returns: {Buffer}
1707
1711
1708
1712
Encrypts ` buffer ` with ` privateKey ` .
1709
1713
1710
1714
` privateKey ` can be an object or a string. If ` privateKey ` is a string, it is
1711
1715
treated as the key with no passphrase and will use ` RSA_PKCS1_PADDING ` .
1712
1716
1717
+ Returns a new ` Buffer ` with the encrypted content.
1718
+
1713
1719
### crypto.publicDecrypt(publicKey, buffer)
1714
1720
<!-- YAML
1715
1721
added: v1.1.0
@@ -1721,6 +1727,7 @@ added: v1.1.0
1721
1727
` crypto.constants ` , which may be: ` crypto.constants.RSA_NO_PADDING ` or
1722
1728
` RSA_PKCS1_PADDING ` .
1723
1729
- ` buffer ` {Buffer | TypedArray | DataView}
1730
+ - Returns: {Buffer}
1724
1731
1725
1732
Decrypts ` buffer ` with ` publicKey ` .
1726
1733
@@ -1730,6 +1737,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`.
1730
1737
Because RSA public keys can be derived from private keys, a private key may
1731
1738
be passed instead of a public key.
1732
1739
1740
+ Returns a new ` Buffer ` with the decrypted content.
1741
+
1733
1742
### crypto.publicEncrypt(publicKey, buffer)
1734
1743
<!-- YAML
1735
1744
added: v0.11.14
@@ -1741,6 +1750,7 @@ added: v0.11.14
1741
1750
` crypto.constants ` , which may be: ` crypto.constants.RSA_NO_PADDING ` ,
1742
1751
` RSA_PKCS1_PADDING ` , or ` crypto.constants.RSA_PKCS1_OAEP_PADDING ` .
1743
1752
- ` buffer ` {Buffer | TypedArray | DataView}
1753
+ - Returns: {Buffer}
1744
1754
1745
1755
Encrypts the content of ` buffer ` with ` publicKey ` and returns a new
1746
1756
[ ` Buffer ` ] [ ] with encrypted content.
@@ -1751,6 +1761,8 @@ treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.
1751
1761
Because RSA public keys can be derived from private keys, a private key may
1752
1762
be passed instead of a public key.
1753
1763
1764
+ Returns a new ` Buffer ` with the encrypted content.
1765
+
1754
1766
### crypto.randomBytes(size[ , callback] )
1755
1767
<!-- YAML
1756
1768
added: v0.5.8
0 commit comments