File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes java JCE version compatibility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "java JCE version compatibility" Watch "java JCE version compatibility" New topic
Author

java JCE version compatibility

mike vas
Greenhorn

Joined: Dec 19, 2006
Posts: 5
Hi guys,

Apologies if my question is a bit naive, but I'm new to encryption and I have many queries....

If I encrypt a message using a keystore with RSA and provider SunJCE in java version 6, could someone who's using java version 1.3 and the same keystore etc. decrypt the message?
Is JCE 6 backward compatible with other versions and vice versa?


Many thanks in advance,

Mike
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
mike vas wrote:Hi guys,

If I encrypt a message using a keystore with RSA and provider SunJCE in java version 6, could someone who's using java version 1.3 and the same keystore etc. decrypt the message?
Mike


No, because direct encryption of data with RSA is not supported in versions prior to ... 1.5 I think, certainly not before 1.4.2

Is JCE 6 backward compatible with other versions and vice versa?


Yes, but that doesn't mean what I suspect you want it to mean. The JCE is a set of classes, for example the Cipher class, as well as a set of abstract service provider classes. What is not part of the JCE are the service provider implementation classes. These classes provide the actual Cipher, Signature, MessageDigest, etc. algorithms implementations. You get an instance of one these implementations through the various getInstance() methods. The default Java runtimes for various versions include different Sun providers. Over time these providers implement more and newer algorithms, so these algorithms will not be available in earlier versions. But a robust bit of code like


should work in any version in the sense that you will either get the algorithm you asked for or get an exception that the algorithm is not available, but there are early providers that do not have AES.

mike vas
Greenhorn

Joined: Dec 19, 2006
Posts: 5
Thanks greg stark...

You've saved me from loads of trouble...
After a small research I decided to use the Bouncy Castle provider...
It seems to be much more flexible for use in heterogeneous java versions (if you use it in both ends)...
Hopefully this one will work the way I think it will...

kind regards,

Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java JCE version compatibility