function
crypto.publicDecrypt
key: KeyLike | PublicDecryptKeyObjectInput | PublicDecryptPrivateKeyInput | PublicDecryptPublicKeyInput | PublicDecryptJsonWebKeyInput,
): NonSharedBuffer;
Decrypts buffer with key.buffer was previously encrypted using the corresponding private key, for example using privateEncrypt.
If key is not a KeyObject, this function behaves as if key had been passed to createPublicKey. If it is an object, the padding property can be passed. Otherwise, this function uses RSA_PKCS1_PADDING.
Because RSA public keys can be derived from private keys, a private key may be passed instead of a public key.
Referenced types
type KeyLike = BinaryLike | KeyObject
interface PublicDecryptKeyObjectInput
interface PublicDecryptPrivateKeyInput
interface PublicDecryptPublicKeyInput
interface PublicDecryptJsonWebKeyInput
type BinaryLike = string | ArrayBufferLike | NodeJS.ArrayBufferView