拿到一個證書,里面有私鑰和公鑰,合在一起,pkc12的格式轉的pem格式,有密碼,現在需要把密碼去掉
1.分離公鑰和私鑰
openssl x509 -in cert2.pem -out cert2.crt
openssl rsa -in cert2.pem -out cert2.key
2. 去掉私鑰密碼
openssl rsa -in cert2.key -out cert22.key
3. 合並成pfx文件
openssl pkcs12 -export -inkey cert22.key -in cert2.crt -out cert2.pfx
4.轉回 pem
openssl pkcs12 -in cert2.pfx -out cert22.pem
這個地方-nodes可能不需要加
中間需要運來私鑰密碼的時候就輸入,如果新的私鑰輸密碼直接回車