qqjianyue代碼工

          砌java代碼
          posts - 62, comments - 9, trackbacks - 0, articles - 10
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          轉載: Keytool command

          Posted on 2011-09-16 16:24 Qzi 閱讀(393) 評論(0)  編輯  收藏

          Java Keytool Commands for Creating and Importing

          These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. Any root or intermediate certificates will need to be imported before importing the primary certificate for your domain.

          • Generate a Java keystore and key pair

            keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048

          • Generate a certificate signing request (CSR) for an existing Java keystore

            keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr

          • Import a root or intermediate CA certificate to an existing Java keystore

            keytool -import -trustcacerts -alias root -file Thawte.crt -keystore keystore.jks

          • Import a signed primary certificate to an existing Java keystore

            keytool -import -trustcacerts -alias mydomain -file mydomain.crt -keystore keystore.jks

          • Generate a keystore and self-signed certificate (see How to Create a Self Signed Certificate using Java Keytool for more info)

            keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048

          Java Keytool Commands for Checking

          If you need to check the information within a certificate, or Java keystore, use these commands.

          • Check a stand-alone certificate

            keytool -printcert -v -file mydomain.crt

          • Check which certificates are in a Java keystore

            keytool -list -v -keystore keystore.jks

          • Check a particular keystore entry using an alias

            keytool -list -v -keystore keystore.jks -alias mydomain

          Other Java Keytool Commands

          • Delete a certificate from a Java Keytool keystore

            keytool -delete -alias mydomain -keystore keystore.jks

          • Change a Java keystore password

            keytool -storepasswd -new new_storepass -keystore keystore.jks

          • Export a certificate from a keystore

            keytool -export -alias mydomain -file mydomain.crt -keystore keystore.jks

          • List Trusted CA Certs

            keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts

          • Import New CA into Trusted Certs

            keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias CA_ALIAS -keystore $JAVA_HOME/jre/lib/security/cacerts


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 西安市| 鹤壁市| 黔江区| 成安县| 韩城市| 凉山| 乃东县| 集安市| 黔江区| 永登县| 锡林郭勒盟| 新巴尔虎右旗| 华宁县| 清徐县| 临汾市| 新余市| 新乡县| 五家渠市| 文水县| 虎林市| 当涂县| 舞阳县| 周宁县| 乌拉特中旗| 汕尾市| 宜黄县| 永新县| 江源县| 牙克石市| 陇西县| 洞口县| 新民市| 房产| 奉贤区| 南溪县| 青海省| 崇仁县| 定结县| 略阳县| 古交市| 忻州市|