func main() { w, _ := armor.Encode(os.Stdout, "PGP MESSAGE", nil) plaintext, _ := openpgp.SymmetricallyEncrypt(w, []byte("golang"), nil) fmt.Fprintf(plaintext, "Hello from golang.\n") plaintext.Close() w.Close() fmt.Print("\n") }
func NewEncrypter(writer io.WriteCloser, key string) (plaintextWriter io.WriteCloser, err error) { return openpgp.SymmetricallyEncrypt(writer, []byte(key), nil, nil) }