RSA private keys cannot be used with cipher.ENCRYPT_MODE

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
vidit
OpenVpn Newbie
Posts: 2
Joined: Wed Aug 12, 2015 12:14 am

RSA private keys cannot be used with cipher.ENCRYPT_MODE

Post by vidit » Wed Aug 12, 2015 12:26 am

I am using Android M (Developer Preview) and I have been unable to connect to my OpenVPN server since I upgraded to Preview 2 (MPZ79M).

The connection works fine using OpenVPN client on Windows. When I connect using Android, I get the following error message:
External PKI Error: java.security.Invalid-KeyException: RSA private keys cannot be used with cipher.ENCRYPT_MODE. Only RSA public key supported for this mode.

It seems java is blocking the process. I know this key was working before this update, and by googling this error I see some posts back from 2012.

Is this something new that android implemented?
Any way to get around it?

If someone want, I can share a temporary pfx key.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: RSA private keys cannot be used with cipher.ENCRYPT_MODE

Post by Traffic » Wed Aug 12, 2015 12:23 pm

vidit wrote:I am using Android M (Developer Preview)
You may have more luck if you inform the Developers of this problem.

FYI this is true:
  • RSA private keys cannot be used with cipher.ENCRYPT_MODE. Only RSA public key supported for this mode
While it is possible the developers made a critical error it is also possible you are using the wrong keys.

vidit
OpenVpn Newbie
Posts: 2
Joined: Wed Aug 12, 2015 12:14 am

Re: RSA private keys cannot be used with cipher.ENCRYPT_MODE

Post by vidit » Wed Aug 12, 2015 11:53 pm

Thanks for responding.

If I am using a private key and a certificate to create a pfx file (I made sure I used the similar command to the one that was given in OpenVPN FAQ), and importing that pfx file in Android, and using Android's key management system for connection - could I have done anything wrong that would lead to this error?

Post Reply