JKS和PKCS12格式

JKS (Java Keystore) is a Java-specific file format that was the default format for KeyStores until Java 8. Starting from Java 9, PKCS#12 is the default KeyStore format. Despite JKS, PKCS#12 is a standardized and language-neutral format for storing encrypted data. The PKCS#12 format is also known as PKCS12 or PFX.

PEM (Privacy Enhanced Mail) is also a certificate container format. The PEM files are encoded in Base64. This ensures that data remains intact during translation between different systems.

Further, a PEM file can contain one or more instances, each of them being separated by a plain-text header and footer:

openssl pkcs12 -in test.p12 -nocerts -nodes -out rsa_origin.key
openssl rsa -in rsa_origin.key -out rsa_pkcs1.pem
openssl rsa -in rsa_origin.key -pubout -out rsa_public_key.pem
openssl pkcs8 -topk8 -inform PEM -in rsa_pkcs1.pem -outform PEM -out rsa_private_pkcs8.pem -nocrypt

將jks文件轉(zhuǎn)未pkcs12格式

keytool -importkeystore -srckeystore client.jks -destkeystore client.pkcs 
 -srcstoretype JKS -deststoretype PKCS12

將pkcs12格式轉(zhuǎn)化為pem文件

openssl pkcs12 -clcerts -nokeys -in test.p12 -out cert.pem
openssl pkcs12 -clcerts -nokeys -out cert.pem -in test.p12
openssl pkcs12 -export -in cert.pem -inkey key.pem -out certificate.p12 -name "certificate"

最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • 達視天津3月26日天氣情況 朋友們,大家早上好!今天是2023年3月26日星期日,農(nóng)歷閏二月初五;當前時間是4:1...
    余則徐閱讀 164評論 0 1
  • 1、你人生最大的任務還是學習、探索和行動。 —— 梁永安 2、舊人不知我近況,新人不知我過往;近況不該舊人知,過往...
    執(zhí)劍飲烈酒閱讀 250評論 0 2
  • 書中提到的名人及相關書籍或文章 1.張文質(zhì)主編《教師怎樣教育自己的子女》 2.蘇聯(lián)教育家馬卡連柯特別強調(diào)父母的示范...
    一朵小紅花呀閱讀 365評論 0 0
  • 二十一世紀舊體詩詞風騷榜[http://www.itdecent.cn/c/da968ae2d498] 上榜絮語...
    張成昱閱讀 288評論 0 14
  • [TOC] 一級標題 二級標題 五級標題 列表fm8.jpg第一項 列表第二項 有序列表第一項 有序列表第二項標題...
    sean1810閱讀 72評論 0 0

友情鏈接更多精彩內(nèi)容