Skip to main content
TLSSocket.prototype.exportKeyingMaterial - node__tls.d.ts - Node documentation
method TLSSocket.prototype.exportKeyingMaterial

Usage in Deno

```typescript import { TLSSocket } from "node:node__tls.d.ts"; ```
TLSSocket.prototype.exportKeyingMaterial(
length: number,
label: string,
context: Buffer,
): Buffer
Keying material is used for validations to prevent different kind of attacks in network protocols, for example in the specifications of IEEE 802.1X. Example ```js const keyingMaterial = tlsSocket.exportKeyingMaterial( 128, 'client finished'); /* Example return value of keyingMaterial: ``` See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more information.

Parameters

length: number
number of bytes to retrieve from keying material
label: string
an application specific label, typically this will be a value from the [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
context: Buffer
Optionally provide a context.

Return Type

Buffer
requested bytes of the keying material