the-wireguard-effect
Version:
Cross platform wireguard api client for nodejs built on wireguard-go with effect-ts
45 lines • 1.26 kB
TypeScript
/**
* Wireguard key schemas and helpers
*
* @since 1.0.0
*/
import * as Schema from "effect/Schema";
/**
* A wireguard key, which is a 44 character base64 string.
*
* @since 1.0.0
* @category Schemas
* @see {@link generateKeyPair}
*
* @see https://lists.zx2c4.com/pipermail/wireguard/2020-December/006222.html
*/
export declare const WireguardKey: Schema.brand<Schema.refine<string, typeof Schema.String>, "WireguardKey">;
/**
* @since 1.0.0
* @category Unbranded Types
*/
export type WireguardKey = Schema.Schema.Type<typeof WireguardKey>;
/**
* Generates a wireguard public private key pair.
*
* @since 1.0.0
* @category Crypto
* @example
* import { generateKeyPair } from "the-wireguard-effect/WireguardKey";
* const { privateKey, publicKey } = generateKeyPair();
*/
export declare const generateKeyPair: () => {
readonly privateKey: WireguardKey;
readonly publicKey: WireguardKey;
};
/**
* Generates a wireguard preshare key.
*
* @since 1.0.0
* @category Crypto
* @example
* import { generatePreshareKey } from "the-wireguard-effect/WireguardKey";
* const preshareKey = generatePreshareKey();
*/
export declare const generatePreshareKey: () => WireguardKey;
//# sourceMappingURL=WireguardKey.d.ts.map