Re: [WSS4J] Exception in WSEncryptBody
Davanum Srinivas <dims-/[email protected]> Mon, 9 Feb 2004 21:28:28 -0800 (PST)
| Newsgroups | gmane.text.xml.wss4j |
|---|---|
| Message-ID | <[email protected]> |
See archives - http://article.gmane.org/gmane.text.xml.wss4j/110 --- "Dimuthu Leelarathne." <[email protected]> wrote: > Hi all, > > I am getting "NoSuchPaddingException" exception from WSEncryptBody when I try to run the doAll > sample. > > WSDoAllSender: Encryption: error during message > processingorg.apache.xml.security.encryption.XMLEncryptionException: > Paddding: ISO10126PADDING not implemented > Original Exception was javax.crypto.NoSuchPaddingException: Paddding: ISO10126PADDING not > implemented > > The exception occur in the client side. > I studied the code carefully and found out the following. > > 1) The exception is thrown from > > java class :: org.apache.ws.security.message.WSEncryptBody > metod :: pulic Document build(Document doc, Crypto crypto) throws Exception > line no :: 274 > > SecretKey symmetricKey = null; > KeyGenerator keyGen = getKeyGenerator(); > symmetricKey = keyGen.generateKey(); > here ------> XMLCipher xmlCipher = XMLCipher.getInstance(symEncAlgo/*, encCanonAlgo */); > xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey); > > > It looks like the problem is with XMLCipher.getInstance(symEncAlgo). It throws this > NoSuchPaddingException. > > > This exception is caught at DoAllSender line no :: 322 > I have given the stack trace at the end of the mail. > > 2) I get this excetpion if I build the code using ant1.5.2 and eclipse. > But When I build the code using Jbuilder I do not get the error. > I am using the same set of jars in every occasion. > I am really, really confused about this point. I am really, really stuck here. > > 3) The stack trace is :: > > WSDoAllSender: Encryption: error during message > processingorg.apache.xml.security.encryption.XMLEncryptionException: Paddding: ISO10126PADDING > not implemented > Original Exception was javax.crypto.NoSuchPaddingException: Paddding: ISO10126PADDING not > implemented > at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:322) > at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71) > at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:157) > at org.apache.axis.SimpleChain.invoke(SimpleChain.java:122) > at org.apache.axis.client.AxisClient.invoke(AxisClient.java:164) > at org.apache.axis.client.Call.invokeEngine(Call.java:2682) > at org.apache.axis.client.Call.invoke(Call.java:2665) > at org.apache.axis.client.Call.invoke(Call.java:2355) > at org.apache.axis.client.Call.invoke(Call.java:2278) > at org.apache.axis.client.Call.invoke(Call.java:1772) > at > org.apache.ws.axis.samples.wssec.doall.axisSec.SecBindingStub.secSend(SecBindingStub.java:104) > at org.apache.ws.axis.samples.wssec.doall.Tester.main(Tester.java:54) > > > I've been struggling with this problem for sometime now. > > Your help is appreciated very much. Thanking in advance, > > Best Regards, > Dimuthu. > ===== Davanum Srinivas - http://webservices.apache.org/~dims/ ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn