clientkeystore访问被拒绝

编程入门 行业动态 更新时间:2024-10-26 19:31:16
本文介绍了clientkeystore访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我想使用keytool创建密钥库时,出现访问被拒绝的错误消息.见下文

When I want to create a keystore with keytool, I get an access denied error message. See below

PS C:\Program Files\Java\jdk1.8.0_144\bin> .\keytool.exe -keystore clientkeystore -genkey -alias client Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: ... What is the name of your organizational unit? [Unknown]: ... What is the name of your organization? [Unknown]: ... What is the name of your City or Locality? [Unknown]: ... What is the name of your State or Province? [Unknown]: ... What is the two-letter country code for this unit? [Unknown]: .. Is CN=..., OU=..., O=..., L=..., ST=..., C=.. correct? [no]: yes Enter key password for <client> (RETURN if same as keystore password): Re-enter new password: keytool error: java.io.FileNotFoundException: clientkeystore (Access is denied) PS C:\Program Files\Java\jdk1.8.0_144\bin>

我该如何解决?

推荐答案

我能够在JDK 1.8.0_171上重现此问题,然后对其进行解决.

I was able to reproduce this on JDK 1.8.0_171 and then resolve it.

基本上,您将由于写入文件而被拒绝访问:

Basically, you are getting an access denied for writing the file:

C:\Program Files\Java\jdk1.8.0_144\bin\clientkeystore

您需要执行以下一项操作:

You need to do one of the following:

从主目录运行命令,并指定密钥库二进制文件的完整路径.

Run the command from your home directory and specify the full path to the keystore binary.

PS> cd $HOME; PS> C:\Program Files\Java\jdk1.8.0_144\bin\keytool.exe -keystore clientkeystore -genkey -alias client

指定具有写访问权的clientkeystore文件的路径.在此示例中,我使用您的主目录:

Specify a path to the clientkeystore file which you have write access to. In this example I am using your home directory:

PS> cd C:\Program Files\Java\jdk1.8.0_144\bin PS> .\keytool.exe -keystore $HOME\clientkeystore -genkey -alias client

(我建议这样做)将JDK bin目录附加到您的Path环境变量中,并指定一个您可以访问的目录:

(I would recommend this) Append the JDK bin directory to you Path environment variable and also specify a directory which you have access to:

PS> $env:Path += "C:\Program Files\Java\jdk1.8.0_144\bin" PS> keytool.exe -keystore $HOME\clientkeystore -genkey -alias client

完成.

更多推荐

clientkeystore访问被拒绝

本文发布于:2023-10-13 00:32:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486299.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:被拒   clientkeystore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!