2

我们公司几周前从 Thawte 购买了代码签名证书。当我们最终收到采购团队的证书时,他们不知道证书的别名!

我似乎无法在没有别名的情况下导入证书,他们根本不知道它是什么。有没有办法检索别名?有没有其他人遇到过这个问题?有没有没有别名的导入方式?

4

2 回答 2

4

别名是在创建 RSA 证书的私钥期间指定的。它不是由证书签名机构决定的,而是由创建私钥和公钥的人决定的。

我不能说您的采购部门是否应该知道这一点,但您需要与生成 CSR 的人员/部门核实,以确定用于生成 CSR 的工具包和密钥存储格式。

现在,假设使用 Java keytool 实用程序创建 CSR,并且私钥在 JKS 密钥库中管理,您可以使用 keytool 命令来确定密钥库的内容(以及别名)。这可以使用keytool -list另一个答案中指示的来完成。下面演示了一个示例运行,别名出现在输出中:

keytool -list -v -keystore foo.jks
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: foo
Creation date: Sep 1, 2010
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=foo, OU=foo, O=foo, L=foo, ST=foo, C=foo
Issuer: CN=foo, OU=foo, O=foo, L=foo, ST=foo, C=foo

请注意,您无需知道密钥库密码即可读取密钥库的内容,在这种情况下将显示警告。

如果您使用其他工具包和/或密钥库格式,则需要采用类似的方法来确定密钥库的内容,因为别名不一定会出现在 CSR 中。

于 2010-09-01T08:13:17.060 回答
1

Try with:

keytool -list -keystore certificate.jks

(Note that if your keystore isn't JKS, for example, PKCS12, you can add an optional -storetype option to change the keystore type:)

keytool -list -keystore certificate.p12 -storetype PKCS12

You'll have something like:

Keystore type: JKS Keystore provider: SUN

Your keystore contains 1 entry

mykey, Feb 1, 2010, trustedCertEntry, Certificate fingerprint (MD5): 0F:73:59:5C:35:8C:F2:F0:27:7E:F7:B7:AF:0A:95:B4

Your certificate alias is shown on the first line of the certificate description, here 'mykey'.

于 2010-09-01T07:55:10.943 回答