Skip to main content
ECDH.prototype.getPublicKey - node__crypto.d.ts - Node documentation
method ECDH.prototype.getPublicKey

Usage in Deno

```typescript import { ECDH } from "node:node__crypto.d.ts"; ```
ECDH.prototype.getPublicKey(
encoding?: null,
format?: ECDHKeyFormat,
): Buffer
The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. If `encoding` is specified, a string is returned; otherwise a `Buffer` is returned.

Parameters

optional
encoding: null
The `encoding` of the return value.
optional
format: ECDHKeyFormat = 'uncompressed'

Return Type

Buffer
The EC Diffie-Hellman public key in the specified `encoding` and `format`.
ECDH.prototype.getPublicKey(): string

Parameters

optional
format: ECDHKeyFormat

Return Type

string