Both the Java and Bouncy Castle act as providers to the standard API.
I think really, your question is, "how do you create a BKS keystore?"

Answer:
1) If you don't already have them, extract the certificates and keys
you want from your JKS keystore using keytool.
2) Put them into a BKS keystore -- again using keytool.

The Bouncy Castle documentation can be found here:
http://www.bouncycastle.org/specifications.html

You'll need to download Bouncy Castle to do this, and likely you'll
need to supply the path information to that install and the provider
class on the command line. I'e not personally done it.

Unfortunately, keytool is extremely clumsy and confusing. I'm not up
for trying to walk you through the whole process right now -- I'll
probably waste time getting confused again myself! But if you get
stuck, ask, and we'll see what we can do.

It seems to be a law or something that crypto tools are -- cryptic.
Even for simple operations like "insert this cert into this store."

The BC documentation says they support PKCS12 keystores. I don't know
offhand if that's true on Android. But there are many tools that can
produce them.

On Jun 30, 11:29 am, Markus Keil <mkei...@googlemail.com> wrote:
> Hi!
>
> I try to secure an TCP-Connection bewteen an Android-App and an Java-
> Application.
> I try to use SSL and CipherInputStream/CipherOutputStream but i can't
> get it working.
>
> on the JAVA-Application it's fine with an JKS-Keystore created with
> keytool.
>
> Code of creating an listening SSL-Socket in the JAVA-Application:
> [code]
> //Setup Keys
>                         KeyStore ks = KeyStore.getInstance("JKS");
>                         ks.load(new FileInputStream("esvdrpkeys"), 
> "esvdrp".toCharArray());
>                         KeyManagerFactory kmf = 
> KeyManagerFactory.getInstance("X509");
>                         kmf.init(ks, "esvdrp".toCharArray());
>                         SSLContext sslcontext = 
> SSLContext.getInstance("SSLv3");
>                         sslcontext.init(kmf.getKeyManagers(), null, null);
>
>                         SSLServerSocketFactory factory =
> sslcontext.getServerSocketFactory();
>                         enc_sock = (SSLServerSocket)
> factory.createServerSocket(esvdrp_port);
> [/code]
>
> Now i want to connect with the Android-app to this ssl-serversocket.
> i've got following problems:
> - JKS is not supported by Android
> - BKS is not supported by the JAVA-Application
> - i don't know how to create an BKS keystore
>
> with the CipherStreams i've got the problem, that i don't know how to
> implement a non-block cipher.
>
> Is there some example Code for an encrypted TCP-Connection between an
> android-app and an JAVA-Application?
>
> Greets Markus

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to