@@ -597,17 +597,36 @@ Exports the encoded challenge associated with the SPKAC.
597597
598598Encrypts ` buffer ` with ` public_key ` . Only RSA is currently supported.
599599
600+ ` public_key ` can be an object or a string. If ` public_key ` is a string, it is
601+ treated as the key with no passphrase and will use ` RSA_PKCS1_OAEP_PADDING ` .
602+
603+ ` public_key ` :
604+
605+ * ` key ` : A string holding the PEM encoded private key
606+ * ` padding ` : An optional padding value, one of the following:
607+ * ` constants.RSA_NO_PADDING `
608+ * ` constants.RSA_PKCS1_PADDING `
609+ * ` constants.RSA_PKCS1_OAEP_PADDING `
610+
611+ NOTE: All paddings are defined in ` constants ` module.
612+
600613## crypto.privateDecrypt(private_key, buffer)
601614
602615Decrypts ` buffer ` with ` private_key ` .
603616
604617` private_key ` can be an object or a string. If ` private_key ` is a string, it is
605- treated as the key with no passphrase.
618+ treated as the key with no passphrase and will use ` RSA_PKCS1_OAEP_PADDING ` .
606619
607620` private_key ` :
608621
609622* ` key ` : A string holding the PEM encoded private key
610- * ` passphrase ` : A string of passphrase for the private key
623+ * ` passphrase ` : An optional string of passphrase for the private key
624+ * ` padding ` : An optional padding value, one of the following:
625+ * ` constants.RSA_NO_PADDING `
626+ * ` constants.RSA_PKCS1_PADDING `
627+ * ` constants.RSA_PKCS1_OAEP_PADDING `
628+
629+ NOTE: All paddings are defined in ` constants ` module.
611630
612631## crypto.DEFAULT_ENCODING
613632
0 commit comments