mirror of
https://github.com/0x5eal/wg-lua.git
synced 2024-12-12 12:50:36 +00:00
feat: add ability to supply private key
This commit is contained in:
parent
0e398939ce
commit
ad8321955d
1 changed files with 5 additions and 0 deletions
|
@ -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));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue