Neha Shukla
Neha Shukla

Reputation: 3660

Unable to import certificate in keytool

I am using following command to import the certificate in KeyStore:

"%JAVA_HOME%"\bin\keytool -importcert -trustcacerts -alias c:\cacert-Service -file c:\e-Service.cer -keystore "%JAVA_HOME%"\jre\lib\security\cacerts

it asked for a password, and show the following result on CMD:

 Certificate was added to keystore
 keytool error: java.io.FileNotFoundException: C:\Program Files (x86)\Java\jdk1.6
 .0_20\jre\lib\security\cacerts (Access is denied)

What is going wrong?

Upvotes: 2

Views: 3986

Answers (2)

Rohit
Rohit

Reputation: 3408

This could happen if you are not running the command prompt in administrator mode. If you are using windows7, you can go to run, type cmd and hit Ctrl+Shift+enter. This will open the command prompt in administrator mode. If not, you can also go to start -> all programs -> accessories -> right click command prompt and say run as administrator.

 http://stackoverflow.com/questions/10321211/java-keytool-error-after-importing-certificate-keytool-error-java-io-filenot?rq=1

Upvotes: 1

Neha Shukla
Neha Shukla

Reputation: 3660

Finally I am able to import certificate in Keytool by opening command pompt in administrator mode by using start -> all programs -> accessories -> right click command prompt and say run as administrator

Upvotes: 1

Related Questions