I am trying to load some
.cer files in to a java
.keystore file, using the keytool command. For one of the .cer file, I am expecting to import it as a
PrivateKeyEntry. However, the result of
"keytool -list" command shows that all certificate are imported as
trustedCertEntry.
In the
"keytool -importcert" command I toggled off the -trustcacerts (idea from
https://stackoverflow.com/questions/24974324/import-certificate-as-privatekeyentry ), but it didn't make a difference on the result for me.
Can you help me on clarifying these questions:
1. can "keytool -importcert" import PrivateKeyEntry into the .keystore file?
2. Is the type (PrivateKeyEntry/trustedCe
rtEntry) of the imported certificates in .keystore decided by the way of importing? or by the .cer file itself?
3. If decided by the way of importing, how to do that?
4. If by the .cer file itself, how to check which type it is?
Thank you!