英文:
Creating or using GPG or SSH keys directly in Go
问题
有没有一些方便的示例、库等可以从Go的crypto/rsa中读取/保存RSA PublicKey和/或PrivateKey类型到GnuPG或OpenSSH密钥格式?显然,编写这个并不难,但肯定有一个良好的例程存在,即使不是针对GnuPG或SSH,也可以转换为OpenSSL,可以将其转换为这些格式。
英文:
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.
答案1
得分: 1
所有与SSH相关的方法都在golang.org/x/crypto/ssh
中(或者现在是2014年12月:github.com/golang/crypto/tree/master/ssh,因为Go切换到了GitHub!)。
读取/保存RSA密钥是在crypto/x509
中进行管理的,正如OP Jeff Burdges所指出的那样。
你可以在这个项目Scalingo/go-ssh-examples
中看到一个很好的例子,它实现了一个SSH服务器(!)和客户端。
这也在文章"使用Go编写一个替代OpenSSH的工具"中有所描述。
英文:
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".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论