Java Keytools 認證轉換成Openssl 的PEM 檔案或keytools 匯出私密金鑰檔案,keytoolspem

來源:互聯網
上載者:User

Java Keytools 認證轉換成Openssl 的PEM 檔案或keytools 匯出私密金鑰檔案,keytoolspem

上一遍又說到Godaddy 生請認證流程與操作;

現因使用Incapsula 防護使用到https,在添加網站時需要自訂認證,其中需要上傳私密金鑰資訊,因公開金鑰是能過keytool 產生所以需要匯出私密金鑰資訊;

匯出的步驟如下:

一:安裝openssl and openssl-devel:

yum -y install openssl openssl-devel

二:能過keytool 匯出認證檔案cer的格式,其中1234567 前面產生tomcat.keystore 檔案密碼:

/usr/java/jre/bin/keytool -export -alias tomcat -storepass 1234567 -file server.cer -keystore tomcat.keystore

三:再通過kyetools  把server.cer 轉換成PKCS 認證檔案,提示要求輸入密碼,請輸入產生密鑰時密碼與定義密鑰密碼:

/usr/java/jre/bin/keytool -v -importkeystore -srckeystore tomcat.keystore -srcalias tomcat -destkeystore my12.p12 -deststoretype PKCS12

四:通過openssl 把pkcs 檔案轉換成PEM檔案:

openssl  pkcs12 -in my12.p12 -out private.pem

再在incapsula 需要上傳key 時上傳pprivate.pem 訪問解決;

 

上屬步驟有可能出現多餘步驟,但因使用一切正常所有寫出來,請路過的大神勿噴!

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.