简体   繁体   中英

Creating or using GPG or SSH keys directly in Go

Are there any handy examples, libraries, etc. that read/save the RSA PublicKey and/or PrivateKey types from Go's crypto/rsa from/to GnuPG or OpenSSH key formats?

It's obviously not hard to write this, but surely a well routine is out there, if not for GnuPG or SSH then for OpenSSL, which can be converted to those .

All ssh-related methods are in golang.org/x/crypto/ssh
(or now Dec. 2014: github.com/golang/crypto/tree/master/ssh , since Go switches to GitHub!).
Read/Save RSA keys is manage in crypto/x509 , as noted by the OP Jeff Burdges .

You can see a good example in this project Scalingo/go-ssh-examples , which implements an ssh server(!) and client.
It is also described in the article " Writing a replacement to OpenSSH using Go ".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM