KeyStore error on java server: BKS not found

I get an error on this line:

final KeyStore keyStore = KeyStore.getInstance("BKS"); 

the error i get is:

 java.security.KeyStoreException: BKS not found at java.security.KeyStore.getInstance(Unknown Source) at AppListen.<init>(AppListen.java:84) 

I added bcprov-jdk16-146.jar to the "Linked Libraries" but still no luck.

My general program allows you to use an Android phone as a mouse and keyboard for a computer that uses an SSL socket connection. The Android application has the same line without errors.

What am I doing wrong?


EDIT:

Perhaps this is well known to most, but it was not for me, so for those like me, this is what I did.

The reason I used BKS was that this is the only format allowed by android, but I did not know that you only need it on the Android side, you can use a different format on the server, and then make a copy of the key and convert it in BKS for use on android, eliminating the need for a BouncyCastle.

I used the JKS key for the server and converted a copy of this key to BKS for use on android using a program called portecle.

+7
source share
2 answers

This error indicates that keytool is trying to create an instance of the BKS repository, but no cryptographic service provider (CSP) can provide such an implementation. BKS Caster type is a type implemented by BouncyCastle CSP
Therefore, you must install the BouncyCastle provider with Java. Supplier Installation
And look at that too.

+4
source

Include the BouncyCastle library in the project and add the provider to the code

 Security.addProvider(new BouncyCastleProvider()); KeyStore keyStore = KeyStore.getInstance("BKS"); 
0
source

All Articles