简体   繁体   中英

Keytool without keystore

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?

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM