KeyStore error on java server: BKS not found
Asked Answered
P

1

9

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 "Referenced Libraries" but still no luck.

My overall program allows an android phone to be used as mouse and keyboard for a computer using an SSL socket connection. The android app has the same line with no errors.

What am i doing wrong?


EDIT:

Maybe this is common knowledge for most, but it wasn't for me, so for those like me this is what i did.

The reason i was using BKS was because that's the only format allowed by android, but i didnt know that you only needed it on the android side, you can use another format on the server and then make a copy of the key and convert it to BKS to use on the android, eliminating the need for BouncyCastle.

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

Philender answered 27/7, 2012 at 10:11 Comment(0)
M
4

Include BouncyCastle library in the project and add provider in code

Security.addProvider(new BouncyCastleProvider());
KeyStore keyStore = KeyStore.getInstance("BKS");
Mv answered 16/5, 2019 at 8:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.