Mac OpenSSL 生成支付宝 2048位密钥
安装OpenSSL:
brew install openssl
然后:
OpenSSL> genrsa -out rsa_private_key.pem 2048 #生成私钥 OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt -out rsa_private_key_pkcs8.pem #Java开发者需要将私钥转换成PKCS8格式 OpenSSL> rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem #生成公钥 OpenSSL> exit #退出OpenSSL程序