func GenerateKey(comment string) (private, public string, err error) {
	key, err := rsaGenerateKey(rand.Reader, KeyBits)
	if err != nil {
		return "", "", errors.Trace(err)
	}

	identity := pem.EncodeToMemory(
		&pem.Block{
			Type:  "RSA PRIVATE KEY",
			Bytes: x509.MarshalPKCS1PrivateKey(key),
		})

	public, err = PublicKey(identity, comment)
	if err != nil {
		return "", "", errors.Trace(err)
	}

	return string(identity), public, nil
}
// GenerateKey makes a 2048 bit RSA no-passphrase SSH capable key.  The bit
// size is actually controlled by the KeyBits var. The private key returned is
// encoded to ASCII using the PKCS1 encoding.  The public key is suitable to
// be added into an authorized_keys file, and has the comment passed in as the
// comment part of the key.
GenerateKey makes a 2048 bit RSA no-passphrase SSH capable key.  The bit
size is actually controlled by the KeyBits var. The private key returned is
encoded to ASCII using the PKCS1 encoding.  The public key is suitable to
be added into an authorized_keys file, and has the comment passed in as the
comment part of the key.
// GenerateKey makes a 2048 bit RSA no - passphrase SSH capable key . The bit // size is actually controlled by the KeyBits var . The private key returned is // encoded to ASCII using the PKCS1 encoding . The public key is suitable to // be added into an authorized_keys file and has the comment passed in as the // comment part of the key .
func GenerateKey(comment string) (private, public string, err error) {
	key, err := rsaGenerateKey(rand.Reader, KeyBits)
	if err != nil {
		return "", "", errors.Trace(err)
	}
	identity := pem.EncodeToMemory(
		&pem.Block{
			Type:  "RSA PRIVATE KEY",
			Bytes: x509.MarshalPKCS1PrivateKey(key),
		})
	public, err = PublicKey(identity, comment)
	if err != nil {
		return "", "", errors.Trace(err)
	}
	return string(identity), public, nil
}
func GenerateKey ( comment string ) ( private , public string , err error ) { key , err := rsaGenerateKey ( rand . Reader , KeyBits ) if err != nil { return " " , " " , errors . Trace ( err ) } identity := pem . EncodeToMemory ( & pem . Block { Type : " " , Bytes : x509 . MarshalPKCS1PrivateKey ( key ) , } ) public , err = PublicKey ( identity , comment ) if err != nil { return " " , " " , errors . Trace ( err ) } return string ( identity ) , public , nil }
GenerateKey makes a 2048 bit RSA no-passphrase SSH capable key.
GenerateKey makes a 2048 bit RSA no - passphrase SSH capable key .