@Stephen C / @ FelixM: IBM does not seem to know at all how RSA cryptography works and how it is intended for use. Basically, both operations (encryption / decryption) should be available for public and private keys.
Public key encryption is required to transmit the client part of the pre private key in SSL / TLS messages. The server needs to decrypt it with a secret key. But if they are negotiating something like ECDHE_RSA, the server needs to REGISTER parts of the handshake using the private key - this is encryption using PrivateKey. Conversely, the client must decrypt using the public key from the server certificate in order to verify the hash value of the signature. (message authentication)
So, if I try to run ECDHE_RSA (server side) on the latest IBM JDK 7, the following will happen:
java.security.InvalidKeyException: Private key cannot be used to encrypt. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) at java.lang.Thread.run(Thread.java:777) at com.ibm.crypto.provider.RSASSL.engineInit(Unknown Source) at javax.crypto.Cipher.init(Unknown Source) at javax.crypto.Cipher.init(Unknown Source) at java.security.Signature$CipherAdapter.engineInitSign(Signature.java:1239) at java.security.Signature$Delegate.init(Signature.java:1116) at java.security.Signature$Delegate.chooseProvider(Signature.java:1076) at java.security.Signature$Delegate.engineInitSign(Signature.java:1140) at java.security.Signature.initSign(Signature.java:522) at net.vx4.lib.tls.core.TLSSignature.createSignature(TLSSignature.java:120)
As you can see, we use "Signature" and call "initSign", which really requires PrivateKey. This proves that IBM is unaware of this fact, and obviously they do not even have valid regression tests!
Use a different cryptography provider and don't trust IBM until they change their mind.
Regards, Christian
source share