From ad8321955d480de2b9bcc36aff0ff91fd813782f Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Wed, 27 Mar 2024 17:12:39 +0530 Subject: [PATCH] feat: add ability to supply private key --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index e4493e0..f13e880 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,6 +11,7 @@ export interface Keypair { export interface Wireguard { generateKeypair(): Keypair; + generatePublicKey(privateKey: number[]): string; } export const wireguard: Wireguard = { @@ -23,4 +24,8 @@ export const wireguard: Wireguard = { privateKey: atob(privateKey), }; }, + + generatePublicKey: function (privateKey) { + return atob(generatePublicKey(privateKey)); + }, };