【发布时间】:2013-04-02 01:10:47
【问题描述】:
我们使用证书在我们的产品中签署 ActiveX。
通常客户会向我发送 spc 和 pvk 文件以及私钥的密码。
我使用 spc 和 pvk 文件生成 pfx 文件并使用此 pfx 文件签署 ActiveX。
之前的证书即将过期,客户向我发送了新证书。
但现在他向我发送了 keystore 文件和带有 BASE64 格式证书的电子邮件。
电子邮件中有以下条目:
Below is your Code Signing certificate:
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Below is the intermediate CA certificate:
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Below is your certificate in pkcs7 format:
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
我做了后续步骤来创建 pfx 文件:
1. Put certificate in pkcs7 format from email to file certificate.p7b.
2. Export certificate in pkcs7 format into certificate.cer file.
openssl.exe pkcs7 -print_certs -in certificate.p7b -out certificate.cer
3. Generate certificate.spc file from certificate.cer.
cert2Spc.exe certificate.cer certificate.spc
4. Export private key from keystore into PKCS#12 (.p12) file.
keytool -importkeystore -srckeystore keystore -destkeystore new-store.p12 -deststoretype PKCS12
5. Extract private key from PKCS#12 to PEM.
openssl.exe pkcs12 -in new-store.p12 -nodes -out private.rsa.pem
6. Create PVK file from PEM.
openssl rsa -in private.rsa.pem -outform PVK -pvk-strong -out FILENAME.pvk
7. Create PFX file from SPC and PVK files.
pvk2pfx.exe -pvk FILENAME.pvk -pi <password> -spc certificate.spc -pfx myproject.pfx -po <password>
这是正确的方法吗?
对我来说有很多步骤。
生成 pfx 文件是否有很多最短路径?
我应该如何处理来自电子邮件的“代码签名证书”?
【问题讨论】:
-
我卡在第 4 步了,知道吗? keytool 错误:java.io.FileNotFoundException: keystore(系统找不到指定的文件)
-
@SteakOverCooked 您应该在
srckeystore参数中指定要从中导出私钥的 Java 密钥库的名称。看起来 Volodymyr 已经有一个预先存在的密钥库,其中可能包含与签名证书关联的密钥对。换句话说,他的密钥库恰好被命名为keystore。
标签: openssl certificate keystore keytool pfx