我们使用证书在我们的产品中对ActiveX进行签名。
通常客户端向我发送spc和pvk文件和私钥密码。
我使用spc和pvk文件生成pfx文件并使用此pfx文件对ActiveX进行签名。获取代码签名证书的步骤
上一个证书即将过期,客户端向我发送新证书。
但现在他给我发送密钥库文件和电子邮件与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(系统找不到t 指定了他的文件) – 2015-01-15 18:06:44
@SteakOverCooked应该指定您想要从srckeystore参数中导出私钥的Java keystore的名称。看起来像Volodymyr已经有一个预先存在的密钥库,可能包含与签名证书关联的密钥对。换句话说,他的密钥库恰好被命名为'keystore'。 – aTotalStranger 2016-12-13 20:07:46