RSA证书生成
MAC用户可以直接打开终端运行以下代码:
echo "设置证书生成的路径"
#!/Users/Ryze/Desktop/RSA bash
echo "1024 RSA key: private_key_bocrps.pem"
openssl genrsa -out private_key_bocrps.pem 1024
echo "create certification require file: rsaCertReq_bocrps.csr"
openssl req -new -key private_key_bocrps.pem -out rsaCertReq_bocrps.csr
echo "create certification using x509: rsaCert_bocrps.crt"
openssl x509 -req -days 3650 -in rsaCertReq_bocrps.csr -signkey private_key_bocrps.pem -out rsaCert_bocrps.crt
echo "create public_key_bocrps.der For IOS"
openssl x509 -outform der -in rsaCert_bocrps.crt -out public_key_bocrps.der
echo "create private_key_bocrps.p12 For IOS. Please remember your password. The password will be used in iOS."
openssl pkcs12 -export -out private_key_bocrps.p12 -inkey private_key_bocrps.pem -in rsaCert_bocrps.crt
echo "create rsa_bocrps_public_key.pem For Java"
openssl rsa -in private_key_bocrps.pem -out rsa_bocrps_public_key.pem -pubout
echo "create pkcs8_private_key_bocrps.pem For Java"
openssl pkcs8 -topk8 -in private_key_bocrps.pem -out pkcs8_private_key_bocrps.pem -nocrypt
echo "finished."
证书名都带_bocrps 这是为bocrps项目生成的RSA证书