PFX 到 JKS 密钥工具的转换:别名 <*>不存在 [英] PFX to JKS keytool conversion: Alias <*> does not exist
问题描述
我正在尝试使用 keytool 将 x.PFX 文件转换为 x.JKS 文件,但出现以下错误:
I'm trying to convert x.PFX file to x.JKS file using keytool but I am getting following error:
keytool error: java.lang.Exception: Alias <2> does not exist
发生此错误之前的操作是:
Actions that preceded this error are:
列出x.PFX文件内容(只是为了读取别名):
keytool -v -list -storetype pkcs12 -keystore x.pfx
Enter keystore password: x
Keystore type: PKCS12
Keystore provider: SunJSSE
Your keystore contains 1 entry
Alias name: 2
Creation date: 11-nov-2012
Entry type: PrivateKeyEntry
Certificate chain length: 3
Certificate[1]:
Owner: CN=x, OU=x, C=x
Issuer: CN=x, O=x, C=x
Serial number: x
Valid from: Wed Oct 24 11:46:10 CEST 2012 until: Fri Dec 13 09:28:40 CET 2013
Certificate fingerprints:
etc.
使用2"作为源别名将 x.PFX 文件转换为 x.JKS 文件
keytool -importkeystore -srckeystore x.pfx -srcstoretype pkcs12 -srcalias 2 -destkeystore x.jks -deststoretype jks -destalias xyz
Enter destination keystore password: y
Re-enter new password: y
Enter source keystore password: x
keytool error: java.lang.Exception: Alias <2> does not exist
我不确定我做错了什么?PFX 文件仅包含一个条目和一个别名 (2).我还尝试使用这些 srcalias 值:2、2"、2".有没有其他方法可以在不知道源别名的情况下使用 keytool 将 PFX 转换为 JKS?
I am not sure what I am doing wrong? PFX file contain only one entry with just one alias (2). I also tried using these srcalias values: 2, "2", " 2". Is there any other way to convert PFX into JKS using keytool without knowing source alias name?
推荐答案
我遇到了完全相同的问题.我已经解决了使用 '1' 而不是 2.不知道为什么,但它有效.
I had the exact same problem. I've solved using '1' instead of 2. Don't know why but it worked.
这篇关于PFX 到 JKS 密钥工具的转换:别名 <*>不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!