Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/ext/net/lib.deno_net.d.ts>Deno.TlsCertifiedKeyPem

A modern runtime for JavaScript and TypeScript.
Latest
interface Deno.TlsCertifiedKeyPem
import { type Deno } from "https://deno.land/x/deno@v2.0.4/ext/net/lib.deno_net.d.ts";
const { TlsCertifiedKeyPem } = Deno;

Provides certified key material from strings. The key material is provided in PEM-format (Privacy Enhanced Mail, https://www.rfc-editor.org/rfc/rfc1422) which can be identified by having -----BEGIN----- and -----END----- markers at the beginning and end of the strings. This type of key is not compatible with DER-format keys which are binary.

Deno supports RSA, EC, and PKCS8-format keys.

const key = {
 key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
 cert: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n" }
};

Properties

optional
keyFormat: "pem"

The format of this key material, which must be PEM.

key: string

Private key in PEM format. RSA, EC, and PKCS8-format keys are supported.

cert: string

Certificate chain in PEM format.