How do I encrypt with an RSA private key read from a PEM file using the Go programming language?

好久不见. 提交于 2019-12-07 16:09:28
James Reinstate Monica Polk

The equivalent function appears to be SignPKCS1v15. The function ParsePKCS1PrivateKey in the crypto/x509 package appears to be the closest to what you need to read in your existing private key, but I'm not sure the PEM format is exactly compatible, which it must be for this to work.

I think you may be looking for crypto/tls, not crypto/rsa.

I'm not 100% sure what you're trying to do here, but the tls package does have some functionality for reading PEM files.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!