mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-23 22:19:49 +00:00
28 lines
589 B
Go
28 lines
589 B
Go
|
package all
|
||
|
|
||
|
import (
|
||
|
"github.com/xtls/xray-core/main/commands/base"
|
||
|
)
|
||
|
|
||
|
var cmdWG = &base.Command{
|
||
|
UsageLine: `{{.Exec}} wg [-i "private key (base64.StdEncoding)"]`,
|
||
|
Short: `Generate key pair for wireguard key exchange`,
|
||
|
Long: `
|
||
|
Generate key pair for wireguard key exchange.
|
||
|
|
||
|
Random: {{.Exec}} wg
|
||
|
|
||
|
From private key: {{.Exec}} wg -i "private key (base64.StdEncoding)"
|
||
|
`,
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
cmdWG.Run = executeWG // break init loop
|
||
|
}
|
||
|
|
||
|
var input_wireguard = cmdWG.Flag.String("i", "", "")
|
||
|
|
||
|
func executeWG(cmd *base.Command, args []string) {
|
||
|
Curve25519Genkey(true, *input_wireguard)
|
||
|
}
|