This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // GenerateSSHKeys generates a private and public ssh key pair with ed25519 algorithm | |
| // and returns the encoded strings | |
| func GenerateED25519SSHKeys() (string, string, error) { | |
| // If rand is nil, crypto/rand.Reader will be used | |
| pub, priv, err := ed25519.GenerateKey(rand.Reader) | |
| if err != nil { | |
| panic(err) | |
| } | |
| p, err := ssh.MarshalPrivateKey(crypto.PrivateKey(priv), "") | |
| if err != nil { |