p12 -> jks
keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -deststoretype jks -destkeystore keystore.jks
jks -> p12
keytool -importkeystore -srckeystore keystore.jks -srcstoretype jks-deststoretype pkcs12 -destkeystore keystore.p12
從jks裡面匯出cert
keytool -export -alias cert0001 -keystore trust.jks -storepass 123456 -file cert0001.cer
將cert匯入jks
keytool -import -v -alias cert001 -file cert001.cer -keystore trust.jks -storepass 123456 -noprompt
去除pem格式的key的密碼(輸出的密碼不輸入即可)
openssl rsa -in cert2.key -out cert22.key
合併pem格式輸出pfx(p12)
openssl pkcs12 -export -inkey cert22.key -in cert2.crt -out cert2.pfx
指定intermedian和ca
openssl pkcs12 -export -out mypkcs12.pfx -inkey my.private.key -in mycert.crt -certfile intermediate.crt -cafile ca.crt
pfx轉回私鑰pem
openssl pkcs12 -in cert2.pfx -out cert22.pem -nodes
私鑰pem轉key
openssl rsa -in cert22.pem -out cert22.key
私鑰pem轉crt
openssl x509 -in cert22.pem -out cert22.crt
cert轉公鑰pem
openssl x509 -in cert2.cer -out cert2.pem -outform pem
公鑰pem轉der
openssl x509 -in cert22.pem -inform pem -out cert22.der -outform der
私鑰pem轉der
openssl rsa -in api_test01_prikey.pem -out test1.der -outform der
der轉私鑰pem
openssl x509 -in cert22.cer -inform der -out cert22.pem -outform pem
pkcs8私鑰轉私鑰pem
openssl rsa -in test_pkcs8.pem -out test_pri.pem
pkcs1公鑰(-----begin rsa public key-----)轉pkcs8公鑰
openssl rsa -rsapublickey_in -in test_rsa_pkcs1_pub.pem -pubout > test_rsa_pkcs8_pub.pem
檢驗私鑰和公鑰是否為同一套, 可以通過檢視 modulus
openssl rsa -noout -modulus -intest.key
openssl req -noout -modulus -in
test.csr
openssl x509 -noout -modulus -in test.cer
openssl 生成自簽CA和pkcs12證書
基礎環境 mkdir test cd test mkdir p ca touch ca index.txt touch ca serial touch ca crlnumber echo 01 ca serial echo 01 ca crlnumber cp etc pki tls openssl...
PKCS12 證書的生成及驗證
pkcs12 證書的生成及驗證 一 生成證書 假設金鑰庫為dlt.p12,庫密碼ipcc 95598,有效期1天,則命令為 keytool genkey v alias root keyalg rsa storetype pkcs12 keystore dlt.p12 dname cn www.ha...
PKCS12 證書的生成及驗證
一 生成證書 假設金鑰庫為dlt.p12,庫密碼ipcc 95598,有效期1天,則命令為 keytool genkey v alias root keyalg rsa storetype pkcs12 keystore dlt.p12 dname cn www.handtimes.com,ou i...