feat: add ability to supply private key

This commit is contained in:
Erica Marigold 2024-03-27 17:12:39 +05:30
parent 0e398939ce
commit ad8321955d
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1

View file

@ -11,6 +11,7 @@ export interface Keypair {
export interface Wireguard { export interface Wireguard {
generateKeypair(): Keypair; generateKeypair(): Keypair;
generatePublicKey(privateKey: number[]): string;
} }
export const wireguard: Wireguard = { export const wireguard: Wireguard = {
@ -23,4 +24,8 @@ export const wireguard: Wireguard = {
privateKey: atob(privateKey), privateKey: atob(privateKey),
}; };
}, },
generatePublicKey: function (privateKey) {
return atob(generatePublicKey(privateKey));
},
}; };