Skip to main content
publicDecrypt - node__crypto.d.ts - Node documentation
function publicDecrypt

Usage in Deno

```typescript import { publicDecrypt } from "node:node__crypto.d.ts"; ```
publicDecrypt(
buffer: ArrayBufferView,
): Buffer
> [!WARNING] Deno compatibility > This symbol is a non-functional stub. Decrypts `buffer` with `key`.`buffer` was previously encrypted using the corresponding private key, for example using [privateEncrypt](../.././node__crypto.d.ts/~/privateEncrypt). If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to [createPublicKey](../.././node__crypto.d.ts/~/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.

Parameters

buffer: ArrayBufferView

Return Type

Buffer