Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SHA1withRSA - how to do that in 2 steps?

843811Nov 20 2008 — edited Nov 21 2008
Hi!

I know it might seem to be a newbie question, but I would really like to get that. I have my certificate and private key. Now I want to sign some data. First I did that with
Signature s = Signature.getInstance("SHA1withRSA", sunRSA); // SunRSASign as provider 
and I got some results. Now I would like to do the same (and get the same results) but doing that in 2 phases (as ideally I would like to create signing server and would like to send only hashes of messages there) and so I did something like:
MessageDigest digest = MessageDigest.getInstance("SHA-1"); 
and hashed my data and then I played with
c = Cipher.getInstance("RSA/ECB/PKCS1PADDING", sun);
c = Cipher.getInstance("RSA/ECB/NOPADDING", sun);
and some others settings but never get the same result. Could someone explain to me what SHA1withRSA is actually equivalent to?

Hope to get some help from you!

Cheers!

Comments

807575
The assertion comes from the code generator, and an assertion is always a bug.

Please be sure you have all the current patches for Sun Studio 11, the C++ patch, and the "compilers back end" patch. You can get all patches here:
http://developers.sun.com/sunstudio/downloads/patches/

If you do not need to support Solaris 8, you should upgrade to Sun Studio 12 (also with current patches).

If after patching the problem is still there, please file a bug report at bugs.sun.com. You will need to include enough information so that we can reproduce the problem. A pointer to a web site with the source code is OK, but please also provide exact instructions for reproducing the compiler assertion.
marc1842fr
Do you get the same error if you recompile with the additional option: -Qoption ccfe -abiopt=mangle6 ? This looks fairly similar to bug 6532605, which cannot be fixed (but is not present on solaris-x64 or linux).
807575
-Qoption ccfe -abiopt=mangle6
Yes this options solve this problem.
I installed latest patches for SS 11 but the problem was still there. I use Sun Update Manager but some patches must be downloaded manually. I think its not possible to have SS12 installed from package with SS11 together so i use SS12 Express-February. The assert error of SS11 is there only with -g option otherwise the same error as SS12.
807575
Side note: it is perfectly all right to install several versions of Sun Studio from packages; just tell the installer to use different base directories, that's all.
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 19 2008
Added on Nov 20 2008
8 comments
2,362 views