1、先生成私钥
openssl genrsa -out rsa_private_key.pem 1024
2、再生成公钥
openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
3、再将PKCS1的私钥转成PKCS8,这样在JAVA中就加解密了
openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform pem -nocrypt -out pkcs8.pem