aspose file tools*
The moose likes Java in General and the fly likes OpenSSL and Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "OpenSSL and Java" Watch "OpenSSL and Java" New topic
Author

OpenSSL and Java

Mazen Mahmoud
Greenhorn

Joined: Oct 25, 2007
Posts: 20
Hi,

I'm trying to encrypt a serialized java file (test.ser) using OpenSSL. I've used the Runtime.getRuntime().exec function and i've passed to it the following string array : {"cmd.exe", "/c", "openssl smime -encrypt...."}
(it will create a new file : test1.ser)

everything works fine. then i've used the openssl to decrypt test1.ser. it will create new file (test2.ser). For some reasons, test2.ser is not similar to test.ser (which must not), and test2.ser cannot be used with FileInputStream and ObjectInputStream to be deserialized using the readObject function. (It will fail on the construction of ObjectInputStream).

Any help???
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
You may have better luck with an OpenSSL-oriented mailing list or forum. Try to solve using OpenSSL from the command line, then come back with java-specific concerns.
The Java API has a built-in crypto capability that may be easier to use within a Java program.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Mazen Mahmoud
Greenhorn

Joined: Oct 25, 2007
Posts: 20
Hi,

I was able to solve it. The problem was in the openssl command...

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OpenSSL and Java