本文共 1593 字,大约阅读时间需要 5 分钟。
之后开管理员控制台,打开openSSL
我的是
C:\OpenSSL-Win32\bin\openssl.exe
genrsa -out rsa_private_key.pem 1024
pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt
之后用文件名搜索rsa_private_key.pem.这个是私钥
我的win8.1不知道为毛跑到C:\Windows\SysWOW64.
rsa_public_key.pem是公钥.复制分割线内的内容即可
-----BEGIN RSA PRIVATE KEY-----MIICXQIBAAKBgQCh/8/kU4Um2FUrkTYXWQDW4MqYuiQQ1WaEtL4JQSy6w64iqWoBDPcS+BFhaPj8gr1Da+F9Up/s7CSj4Do5h3kMHmRfXu2Ba/Hxczf/QB+Cutm386roP41bAKolkUVgWlZEDjOc4+sqrPygxDa0dtbugrdSvJXqUcmJSIkVnVXj0QIDAQABAoGAJKmwcwwz5kavf9ytUTtjZT4am9YEs4qYWRBOsel+JgaDMnUE+JfmkvRxeoo3T26HRurzbVl1uDj5Ud09UCfIzQkmJr1g7AG2Rb1qMGILjz2u5rIve8Q/lwi+nd8exNSJ+IYOkoBRCfpUX6ALa/rcBikHeZFS/QMVWNPG8gSXwQECQQDMWV8WHfSLn6CVQ5Lvg1hVBvFutCZ6BPBNdIi5gQahVsaZ2HH4UlZa8nfiZlojyZiyi9sahwjI0nlgrbwng61VAkEAyvImDq9akdpVf4JoPMvrRhjYLMMmgWbOhqZyoSU23pOP9OyOW2FrdbFXM13QsEGDBCDtrXCrlD8127WxFHG8jQJAMUcsAu1eV307AEO3X0LRPk/aUNPoo2wldsgvYGyY6LdAVUE42qUgZfYqqtH70r1+sS/AunjtyV/YHVRIF09NsQJBAIJc/dldBr6+E0GvESpMizsh5msKiIeC9JNGBEhDUXW0MDrSYbeNYqvdWPhkARPXYUObq1FIGM9Hs18I3VEWplkCQQC0gZUolARBWozZyhqEyHGW2Tb/ZPZrhNWt0a3yjuqYEFSOe9WxanF4j2bYAgbGOYyiNHj/IcC4bpUdJeXmTGTz-----END RSA PRIVATE KEY----------BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCh/8/kU4Um2FUrkTYXWQDW4MqYuiQQ1WaEtL4JQSy6w64iqWoBDPcS+BFhaPj8gr1Da+F9Up/s7CSj4Do5h3kMHmRfXu2Ba/Hxczf/QB+Cutm386roP41bAKolkUVgWlZEDjOc4+sqrPygxDa0dtbugrdSvJXqUcmJSIkVnVXj0QIDAQAB-----END PUBLIC KEY-----
java生成的密钥的第一步略有不同
OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt
具体看那个open支付宝的链接,嘿嘿.
转载地址:http://thmaa.baihongyu.com/