Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto/openpgp: encrypt private key documentation missing #16994

acasajus opened this issue Sep 5, 2016 · 2 comments

x/crypto/openpgp: encrypt private key documentation missing #16994

acasajus opened this issue Sep 5, 2016 · 2 comments


Copy link

@acasajus acasajus commented Sep 5, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_m/s8xbjvsx05d7g5vm9b0wlsc00000gn/T/go-build341779350=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Tried to encrypt a openpgp.packet.PrivateKey and dump it in a PGP armor.

What did you expect to see?

An example on how to do it. I haven't found any way to do it. I would like a pointer in how to export a private key encrypting it with a passphrase. The inverse of openpgp.packet.PrivateKey.Decrypt.

What did you see instead?

No information on how to do it.

@bradfitz bradfitz added this to the Go1.8 milestone Sep 5, 2016
@odeke-em odeke-em changed the title crypto: openpgp encrypt private key documentation missing x/crypto/openpgp: encrypt private key documentation missing Sep 8, 2016
@quentinmit quentinmit modified the milestones: Soon, Go1.8 Sep 29, 2016
Copy link

@odeke-em odeke-em commented Feb 18, 2017

From #16664 it seems like encrypting Private keys is not yet implemented so IMO this issue is a feature request for something non-existent right now, thus we should merge it into #16664. What do y'all think?

@bradfitz bradfitz modified the milestones: Go1.9, Soon Feb 19, 2017
@bradfitz bradfitz modified the milestones: Unreleased, Go1.9 May 23, 2017
Copy link

@FiloSottile FiloSottile commented Mar 29, 2021

Per the accepted #44226 proposal and due to lack of maintenance, the package is now frozen and deprecated. No new changes will be accepted except for security fixes. The package will not be removed.

If this is a security issue, please email and we will assess it and provide a fix.

If you're looking for alternatives, consider the crypto/ed25519 package for simple signatures, for inline signatures, or for encryption. You can read a summary of OpenPGP issues and alternatives here.

If you are required to interoperate with OpenPGP systems and need a maintained package, we suggest considering one of multiple community forks of We don't endorse any specific one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants