将 .cer 证书转换为 .jks
I need to convert a .cer
file to a .jks
file.
I saw a few questions about it, but haven't seen a solution to what I need.
I don't need it in order to add it to my local certificates, but as a file to upload to a server. I also need to do it only once, and not programmatically. There's this thread Converting .cer to .jks using java and the author says he had done it successfully, but I couldn't comment to his last reply as I don't have enough reputation, nor could I send him a personal message and ask him.
So if anyone knows of a simple way to do so, I'll be glad to hear.
解决方案keytool
comes with the JDK installation (in the bin
folder):
keytool -importcert -file "your.cer" -keystore your.jks -alias "<anything>"
This will create a new keystore and add just your certificate to it.
So, you can't convert a certificate to a keystore: you add a certificate to a keystore.
相关文章