keytool 证书生成似乎挂在命令行中

发布于 2024-12-19 19:42:49 字数 438 浏览 1 评论 0原文

我在命令行中使用 keytool 时遇到了潜在的问题,或者可能缺乏耐心。我已经成功创建了密钥库,并且还成功生成了证书请求。但是当我尝试从请求生成证书时,它似乎挂起。

在命令行中,这就是我得到的全部内容,

C:\Users\Mark\Desktop\Assignment 9>keytool -gencert -keystore myKeys\myKeys.keys
tore -alias mr -v
Enter keystore password:
Enter key password for <mr>

我没有得到新的提示,它只是像命令行上那样坐在那里。所以我取消了它并再次尝试了几次但没有成功。我还注意到进程管理器中正在运行一个 keytool.exe。我不确定这是否是一个漫长的过程,以及我是否应该将其保留一段时间,或者是否存在可能挂起命令的命令原因。

Im having a potential issue, or possibly a lack of patience, using keytool in the command line. Ive created a keyStore successfully and i also generated a certificate request successfully. But when I attempt to generate the certificate from the request it appears to hang.

In the command line this is all i get

C:\Users\Mark\Desktop\Assignment 9>keytool -gencert -keystore myKeys\myKeys.keys
tore -alias mr -v
Enter keystore password:
Enter key password for <mr>

I do not get a new prompt, it just sits there like that on the command line. SO i cancel it and tried again a few times with no avail. Ive also toook note that in the process manager there is a keytool.exe running. I'm not sure if this is a long process or not and if i should leave it to its self for a bit or if there is a command cause that may hang the command.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

南风起 2024-12-26 19:42:49

我在centos 6 docker容器内遇到了这个问题

我运行的命令是...

keytool -import -noprompt -alias root -keystore ./out/keystore.jks -trustcacerts -file ./out/parent.crt -storepass ${jkspass};

我尝试更改Java版本(更改为在容器外部工作的版本)并尝试了-infile如下...

keytool -import -noprompt -alias root -keystore ./out/keystore.jks -trustcacerts -infile ./out/parent.csr -file ./out/parent.crt -storepass ${jkspass};

但没有任何效果!增加内存也没有解决问题。
我切换到官方 Java docker 容器。
没有工作。
我最终放弃了。

如果有人知道此问题的解决方法,请告知。

I had this problem inside a centos 6 docker container

The command I was running is ...

keytool -import -noprompt -alias root -keystore ./out/keystore.jks -trustcacerts -file ./out/parent.crt -storepass ${jkspass};

I tried to change the Java version (to a version that works outside the container) and tried -infile as below ...

keytool -import -noprompt -alias root -keystore ./out/keystore.jks -trustcacerts -infile ./out/parent.csr -file ./out/parent.crt -storepass ${jkspass};

But nothing worked! Increasing memory did not fix issue either.
I switched to an official Java docker container.
Did not work.
I gave up in the end.

If anyone knows the fix for this please advise.

泛滥成性 2024-12-26 19:42:49

也被这个问题绊倒了——当然忘记了提供 -infile 参数来指定输入 CSR 文件,所以 keytool 坐在那里等待输入。

(强制中止命令时显示的错误中有提示:keytool error: java.io.IOException: Encoding bytes tooshort。)

Tripped on this too - had of course forgotten to supply the -infile parameter to specity the input CSR file, so keytool was sitting there waiting for input.

(There was a hint in the error shown when the command was forcibly aborted: keytool error: java.io.IOException: Encoding bytes too short.)

染柒℉ 2024-12-26 19:42:49

不是很长 - 最多 5 秒。你有没有尝试过:
1. 查看handle.exe,也许有人持有密钥库?
2. 尝试另一个java版本?

Not very long - 5 sec max. Have you tried:
1. Look in handle.exe maybe somebody hold keystore?
2. Try another java version?

木落 2024-12-26 19:42:49

我想你有错误的参数,我在写时遇到了这样的问题:

keytool -import -alias myCert -keystore "C:\Program 
Files\Java\jdk1.8.0_144\jre\lib\security\cacerts -file myCert.cer

问题是因为我打开了 simbold " 但没有关闭。要修复我已经写的:

keytool -import -alias symantec -keystore "C:\Program 
Files\Java\jdk1.8.0_144\jre\lib\security\cacerts" -file symantec-root.cer

所以我相信你有一些参数女巫是不正确的

I presume you have wrong params, I had such issue when I wrote:

keytool -import -alias myCert -keystore "C:\Program 
Files\Java\jdk1.8.0_144\jre\lib\security\cacerts -file myCert.cer

Issue was cause I opened simbold " but not closed. To fix I've written:

keytool -import -alias symantec -keystore "C:\Program 
Files\Java\jdk1.8.0_144\jre\lib\security\cacerts" -file symantec-root.cer

So I believe you have some parateters witch is incorrect

单挑你×的.吻 2024-12-26 19:42:49

我在使用 keytool 迁移密钥库时遇到了同样的问题。更糟糕的是生成的密钥库没有正确的密码。

我意识到我修改了 JDK 中的默认安全提供程序,添加了 BuncyCastle FIPS 兼容。

我恢复了原来的状态,一切正常。

I had the same problem migrating a keystore with keytool. Even worse the generated keystore did not have the correct password.

I realized that I modified the default security providers in my JDK, adding BuncyCastle FIPS compatible.

I reverted back the original ones and everything worked fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文