Hi Stephan,
Have you been able to solve this problem?
I am facing similar issue.
Thanks in advance.
-

On Nov 9, 1:46 pm, stephan <[email protected]> wrote:
> Hi,
>
> 'm working on a litte HTTP server application for the Android. Now I
> like to secure the communication by using SSL. But I got stuck by
> creating a suitable  keystorefile.
> Searching the archives I came to the conclusion that it will be best
> to use a BKS typekeystoresince all otherkeystoretypes (like JKS)
> are not supported on the android.
>
> Unfortunately I can't figure out a way to setup thekeystorefile.
> I tried OpenSSL - wrongkeystoreformat.
> I tried the keytool from JDK - rightkeystoreformat but it doesn't
> support BKS keystores.
> I tried the Keytool IUI - I could create a BKS typekeystorebut it
> alwais ends up in an InvalidKeyException "Illegal key size". No matter
> if I try to create a new certificate or import it from a JKSkeystore.
> (I tried to create the RSA ver.3 certificate with a key size of 2048
> and 1024 bits.)
>
> How do you create BKS keystores?
>
> For completeness here's the code I trying to use for loading thekeystore:
>
>                         SSLContext ctx;
>                         KeyManagerFactory kmf;
>                        KeyStoreks;
>                         InputStreamkeyStore= 
> context.getResources().openRawResource
> (R.raw.serverkey);
>                         ctx = SSLContext.getInstance("TLS");
>                         //X509
>                         String mkAlgortithm = 
> KeyManagerFactory.getDefaultAlgorithm();
>                         kmf = KeyManagerFactory.getInstance(mkAlgortithm);
>                         //BKS
>                         String ksType =KeyStore.getDefaultType();
>                         ks =KeyStore.getInstance (ksType);
>
>                         ks.load(keyStore,passPhrase);
>                         kmf.init(ks, passPhrase);
>                         KeyManager[] keyManagers = kmf.getKeyManagers();
>                         ctx.init(keyManagers, null, null);
>
> Maybe you can also provide me with a link about how to handle the
> handshake process?
>
> Thanks,
> Stephan

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

Reply via email to