Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KeyStoreException: This keystore does not support probing and must be loaded with a specified type [closed]

I'm getting this error while trying to add .crt certificate to already existing keystore via terminal. I'm using Linux Ubuntu 18.04LTS with Java 11

I tried to run this command:

$ keytool -import -alias ca -file my_certificate_file_name.crt -keystore my_truststore_file_name

And also tried to run without alias:

$ keytool -import -file my_certificate_file_name.crt -keystore my_truststore_file_name
like image 254
Sergey Kim Avatar asked Dec 05 '25 08:12

Sergey Kim


1 Answers

The problem was that Android uses another type of truststore named "BKS". Commands in question were related to "JKS" type of truststore.

$ keytool -importcert -v -trustcacerts -file "your_cert_file" -alias ca -keystore "your_truststore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "path_to_bcprov-jdk16-145.jar" -storetype BKS -storepass your_password

Besides, it is required to download "bcprov-jdk16-145.jar" file. You can do it from maven repo: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk16/1.46

After executing the command above in terminal, "BKS" truststore was successfully created.

like image 139
Sergey Kim Avatar answered Dec 06 '25 22:12

Sergey Kim