`
dch1287
  • 浏览: 120140 次
  • 性别: Icon_minigender_1
  • 来自: 魔都
社区版块
存档分类
最新评论

How to convert a PKCS#12 to JKS

阅读更多
下面提供两种方式:
1. 使用Portecle
2. 使用Jetty的工具类
3. 使用Keytool GUI(这个工具现在不太好找,功能类似Portecle)
4. 使用OpenSSL + Keytool
5. 自己写代码(使用BouncyCastle的jar)


---------------------------------------
使用Portecle

Most of system administrators use OpenSSL (which is not a good idea, but it’s an another story) to manage their PKI. While OpenSSL is good to create/convert X509 certificates from PEM/DER to PKCS#12 (and vice versa, for sure) it doesn’t understand the JKS (Java KeyStore) format. JKS are used in Java world, for example Glassfish application server, OpenDS and so more. In this post, I’ll explain how to convert a PKCS#12 to a JKS using portecle. portecle is a small, but very useful application (written in Java) to manipulate keystores.

1. Download portecle, extract it, and lauch it using java -jar portecle.jar
2. Open your PKCS#12 file, provide the password
3. Click on Tools/Change KeyStore Type/JKS menu
4. If you don’t want to use the default password (which is password), click on the menu keystore password
5. Save it, that’s all folks!

You can know list the contents of your JKS using keytool:


% keytool -list -v -keystore yourkeystore.jks

from: http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/



----------------------------------------------
使用Jetty的工具类

java -classpath jetty-6.1.3/lib/jetty-6.1.3.jar org.mortbay.jetty.security.PKCS12Import keystore.pkcs12 keystore.jks

Enter input keystore passphrase: secret
Enter output keystore passphrase: secret
Alias 0: 1
Adding key for alias 1


http://jetty.codehaus.org/jetty/jetty-6/apidocs/org/mortbay/jetty/security/PKCS12Import.html
http://conshell.net/wiki/index.php/OpenSSL_to_Keytool_Conversion_tips


分享到:
评论

相关推荐

    按PKCS#10数据格式封装PKCS#10数据

    按照ASN.1语法,解析证书请求数据包,再按PKCS#10格式封装证书请求数据。

    pkcs#11标准中文文档

    关于pkcs#11标准库接口的中文文档,很详细,对于初学者要使用pkcs#11标准接口来说,非常有用。

    PKCS#11的部分使用例码

    PKCS#11的部分使用例码 PKCS#11的部分使用例码

    使用数字证书进行PKCS#7数字签名

    越来越多的应用需要我们使用USB接口数字证书进行PKCS#7数字签名。本文分别介绍了使用微软CryptoAPI方式和OpenSSL Engine方式进行数字签名。特别地,提出了OpenSSL Engine简化方式,这种方式更为灵活方便易行。

    rfc7292 - PKCS #12.pdf

    PKCS #12: Personal Information Exchange Syntax v1.1

    C# SHA256 PKCS#7 生成验名、验签源码 中行支付.rar

    C# SHA256 PKCS#7 生成验名、验签源码 中行支付.

    pkcs-11v2-20d3.rar_PKCS#1_PKCS#11 USBKey_RSA PKCS_pkcs_usbkey

    在密码系统中,PKCS#11是公钥加密标准(PKCS, Public-Key Cryptography Standards)中的一份子 ,由RSA实验室(RSA Laboratories)发布[1],它为加密令牌定义了一组平台无关的API ,如硬件安全模块和智能卡。...

    PKCS#1 java 语言实现参考 V1.0

    基于BigInteger类用java封装的PKCS#1 v2.1 全算法实现,模块与规范一一对应。包含 I2OSP OS2IP RSAEP RSADP RSASP1 RSAVP1 RSAES-OAEP RSAES-PKCS1_v1_5 RSASSA-PSS RSASSA-PKCS1-v1_5 以及 MGF SourceAlgrithm等...

    企业微信支付到个人银行卡(PKCS#1格式的公钥转为PKCS#8格式)

    网上有例子,自己遇到了坑(公钥的格式不对导致一直报公钥非法错误,里面有详细解决过程)

    PKCS#7格式加解密验签

    提到PKCS,首先想到的是RSA的证书格式(类似,PKCS8,P12等),最近在和一家俄罗斯支付对接时,对方说加密成PKCS#7格式,当时就懵了,以为对方说错了,在这块卡了好几天,通过查资料,终于找到方法了。确实是PKCS#7...

    PKCS #12 中文版

    本标准描述了个人身份标识信息传递语法,包括私钥、证书、各种形式的秘密值及其扩展。支持本标准的计算机、应用程序、浏览器、因特网服务等等将允许用户导入、导出并且使用一套统一的个人身份标识信息。

    C# pkcs # 7 签名 验签

    C# 语言,.net平台下实现pkcs # 7 签名 验签,C# 语言,.net平台下实现pkcs # 7 签名 验签

    PKCS #1: RSA Cryptography Specifications Version 2.2

    PKCS #1: RSA Cryptography Specifications Version 2.2 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1. Requirements Language . . . . . . . . . . . . . . . . . ...

    pkcs#7标准格式

    文档介绍了pkcs#7的格式和结构,里面虽然是英文的,但是很详细的,能看到,另外用ASN1工具和这个结合能很快的理解pkcs#7的结构。

    pkcs#1_V2.1.zip

    PKCS#1 V2.1版本 定义RSA公开密钥算法加密和签名机制,主要用于组织PKCS#7中所描述的数字签名和数字信封

    PKCS (公钥密码标准)

    • PKCS #1: RSA Cryptography Standard RSA密码标准 • PKCS #7: Cryptographic Message Syntax Standard密文信息语法标准 ...• PKCS #12: Personal Information Exchange Syntax Standard 个人信息交换语法标准

    PKCS#11 v2.2(DOC)

    本标准为那些保存密码信息,执行密码... 它遵循一种基于对象的简单方法,提出技术独立性(各种各样的设备)和资源共享(多个应用程序访问多个设备)的目标,把设备的一种通用的逻辑视图,即密码令牌,提供给应用程序。

    PKCS #1 v2.2 RSA Cryptography Standard.pdf

    RSA规范标准

    pkcs#12官方文档

    pkcs#12格式证书的官方说明文档,对于编程和分析非常有用

Global site tag (gtag.js) - Google Analytics