不對輸出的文件內容進行加密加密
openssl genrsa -out private-rsa.key 1024
對輸出的文件內容進行加密(DES/AES128/AES256等)spa
openssl genrsa -out rsa.pem -aes128 -passout pass:123456 1024
私鑰轉換成PKCS8格式code
openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt > rsa_private_key_pkcs8.pem
openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key_2048.pub
openssl req -new -x509 -key private-rsa.key -days 7300 -out public-rsa.cer
pkcs12 -export -name test-alias -in public-rsa.cer -inkey private-rsa.key -out ctrip_rsa.pfx