Hello,

I am trying to establish a SSL connection and send messages using it.
I use MINA for this however i get the following error:

Caused by: java.security.InvalidKeyException: The public key in the
certificate cannot be used for ENCRYPT_MODE
     at javax.crypto.Cipher.init(Cipher.java:815)
     at javax.crypto.Cipher.init(Cipher.java:747)
     at
org.apache.harmony.xnet.provider.jsse.ClientHandshakeImpl.processServerHelloDone(ClientHandshakeImpl.java:
418)


I found out in the Cipher class that this exception is thrown if I
want to use the certificate for encryption and the certificate has set
extension "critical" but doesn't have extension "encipherOnly".

I tried both - removing extension critical and setting it together
with encipherOnly for the key that I am using. Both throw the same
exception.Even though it doesnt make any sense.

Interesting is that the same key works on my java server running on
windows machine. Isn't it possible that there is some bug in android
that is causing this? Is there any workaround for this?

Thank you

Palo

-- 
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