func NewSSHKeyPair(passphrase []byte) (*SSHKeyPair, error) {
	s := &SSHKeyPair{}
	if err := s.GenerateRSAKeys(rsaDefaultBits, passphrase); err != nil {
		return nil, err
	}
	if err := s.WriteKeys(); err != nil {
		return nil, err
	}
	return s, nil
}
NewSSHKeyPair generates an SSHKeyPair, which contains a pair of SSH keys.
The keys are written to disk.
package keygen
import (
	"bytes"
	"crypto/ed25519"
	"crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"encoding/pem"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"os/user"
	"path/filepath"
	"github.com/charmbracelet/charm"
	"github.com/mikesmitty/edkey"
	"github.com/mitchellh/go-homedir"
	"golang.org/x/crypto/ssh"
)
const rsaDefaultBits = 4096
var ErrMissingSSHKeys = errors.New("missing one or more keys; did something happen to them after they were generated?")
type SSHKeysAlreadyExistErr struct {
	path string
}
func (e SSHKeysAlreadyExistErr) Error() string {
	return fmt.Sprintf("ssh key %s already exists", e.path)
}
type FilesystemErr struct {
	error
}
func (e FilesystemErr) Error() string {
	return e.error.Error()
}
func (e FilesystemErr) Unwrap() error {
	return e.error
}
type SSHKeyPair struct {
	PrivateKeyPEM []byte
	PublicKey     []byte
	KeyDir        string
	Filename      string  
}
func (s SSHKeyPair) privateKeyPath() string {
	return filepath.Join(s.KeyDir, s.Filename)
}
func (s SSHKeyPair) publicKeyPath() string {
	return filepath.Join(s.KeyDir, s.Filename+".pub")
}