Hi All,
 
We use WSS4J for encrypting/decrypting messages that are sent via axis to our 
webservice consumers. With some modifications to WSS4J, we could get the 
encryption/decryption work with Java 1.4.2. To be precise, one of our 
developers, overwrote the WSEncryptBody class and modified the 
"cipher.init(Cipher.ENCRYPT_MODE, remoteCert);" in build() api to 
"cipher.init(Cipher.WRAP_MODE, remoteCert);". 
 
Now, we are in a process to move to Java 5 and are experiencing a problem where 
WSS4J reports the subject error. We included the new 1.5 jars for WSS4J. The 
exception thrown is:
 
INFO   | jvm 1    | 2007/03/07 11:06:10 | Caused by: 
org.apache.ws.security.WSSecurityException: Cannot encrypt/decrypt data; nested 
exception is: 
INFO   | jvm 1    | 2007/03/07 11:06:10 |  java.lang.IllegalStateException: 
Cipher not initialized for encryption/decryption
INFO   | jvm 1    | 2007/03/07 11:06:10 |  at 
com.mycompany.security.xml.WSEncryptBody.build(WSEncryptBody.java:370)
 
Has anybody experienced this exception? Appreciate any help.
 
Thanks,
Abbas


 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

Reply via email to