Stuff
This commit is contained in:
parent
c1840caa36
commit
c453ea7231
1 changed files with 13 additions and 0 deletions
13
key.go
Normal file
13
key.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package gowgpkg
|
||||
|
||||
import "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||
|
||||
func CreatePrivateKey() (publicKey, privateKey string, err error) {
|
||||
r, err := wgtypes.GeneratePrivateKey()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
privateKey = r.String()
|
||||
publicKey = r.PublicKey().String()
|
||||
return
|
||||
}
|
Loading…
Reference in a new issue