Keytool without keystore

给你一囗甜甜゛ 提交于 2019-12-12 06:45:54

问题


I have a question about keytool..

I would to use this command:

keytool -importkeystore -srckeystore foo.jks -destkeystore foo.p12 -srcstoretype jks -deststoretype pkcs12

Can I don't specify the srckeystore? I need this request because I don't know my keystore that I use.. :) I created the certificate in this way:

keytool -genkey -alias myalias -keyalg RSA -keysize 2048

so, I don't have specified the keystore...In this way, Keytool which keystore will use?


回答1:


If you use the keytool command to generate a keystore and you do not have a -keystore option, it will create the keystore in the default location, which is the user's home directory. And the filename will be ".keystore".

For the -importkeystore option, -srckeystore is required, so you will have to give the path to the ".keystore" file that you created.

To avoid this confusion, when you create a new keystore, give it a known filename by using the -keystore option.

For example:

keytool -genkey -alias myalias -keyalg RSA -keysize 2048 -keystore foo.jks

Now your command to convert it to a PKCS12 keystore should work.

For more details, see the keytool documentation.




回答2:


Never actually tried it but if my memory serves me right the default keystore is called keystore.jks

You can probably run the following to be sure;

keytool -v -list

and it should tell you the keystore type.



来源:https://stackoverflow.com/questions/19958092/keytool-without-keystore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!