Skip to main content
DiffieHellman.prototype.setPublicKey - node__crypto.d.ts - Node documentation
method DiffieHellman.prototype.setPublicKey

Usage in Deno

```typescript import { DiffieHellman } from "node:node__crypto.d.ts"; ```
DiffieHellman.prototype.setPublicKey(publicKey: ArrayBufferView): void
Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected to be a string. If no `encoding` is provided, `publicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.

Parameters

publicKey: ArrayBufferView

Return Type

void
DiffieHellman.prototype.setPublicKey(
publicKey: string,
encoding: BufferEncoding,
): void

Parameters

publicKey: string
encoding: BufferEncoding

Return Type

void