Skip to main content Link Search Menu Expand Document (external link)

WireguardKey.ts overview

Wireguard key schemas and helpers

Since v1.0.0


Exports Grouped by Category


Crypto

generateKeyPair

Generates a wireguard public private key pair.

Example

import { generateKeyPair } from "the-wireguard-effect/WireguardKey"
const { privateKey, publicKey } = generateKeyPair()

Signature

declare const generateKeyPair: () => { readonly privateKey: WireguardKey; readonly publicKey: WireguardKey }

Source

Since v1.0.0

generatePreshareKey

Generates a wireguard preshare key.

Example

import { generatePreshareKey } from "the-wireguard-effect/WireguardKey"
const preshareKey = generatePreshareKey()

Signature

declare const generatePreshareKey: () => WireguardKey

Source

Since v1.0.0

Schemas

WireguardKey

A wireguard key, which is a 44 character base64 string.

See

  • generateKeyPair
  • https://lists.zx2c4.com/pipermail/wireguard/2020-December/006222.html

Signature

declare const WireguardKey: Schema.brand<Schema.refine<string, typeof Schema.String>, "WireguardKey">

Source

Since v1.0.0

Unbranded Types

WireguardKey (type alias)

Signature

type WireguardKey = Schema.Schema.Type<typeof WireguardKey>

Source

Since v1.0.0