# Signing/verification between Java and the OpenSSL

I'm trying to sign/verify data between a C application and a Java application.

In java for now I was using the built-in JCE provider with SHA256withRSA as algorithm. On the C part I'm using OpenSSL RSA_sign/RSA_verify methods with NID_sha256 as type.

With this configuration I can't verify in my java application data signed from the C one and vice versa. It seems that SHA256withRSA is using PKCS#1 v1.5 and openssl state that they use PKCS# 2.0 as padding (source).

This is why I think that the problem could come from this padding difference, but I can't find any JCE provider that support the v2.0 padding.

Is this correct? What is the difference between these paddings?

• I edited your question to ask a slightly different question that the answer below answers. This is because the original question was in my opinion off topic as it was a programming problem to be solved. If you disagree, you can roll back my edit.
– otus
Nov 20 '15 at 7:53
• No, you are right, this is a good edit ! Nov 20 '15 at 8:49