I would like to generate OpenPGP key pairs and encrypt them using 'passphrases' before exporting them. I would like to do so in Go, using its openpgp package. So far I have generated key pairs, exported them and successfully imported the public keys in GnuPG for encryption, using the simple wrapper linked here.
I still need to encrypt the private keys using 'passphrases' before exporting them in ASCII armor though. Could someone please provide me with an example or some hint on how to do this?