package main import ( "fmt" "forge.cadoles.com/Cadoles/go-http-peering/crypto" ) func createKey() { passphrase, err := getPassphrase() if err != nil { handleError(err) } key, err := crypto.CreateRSAKey(keySize) if err != nil { handleError(err) } privatePEM, err := crypto.EncodePrivateKeyToEncryptedPEM(key, passphrase) if err != nil { handleError(err) } fmt.Print(string(privatePEM)) }