[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-java-dev
Subject:    Re: [Dev] [ESB] Illegal key size exception from AxisEngine when sending an encrypted request
From:       Chathura Priyankara <chathurap () wso2 ! com>
Date:       2015-01-30 16:20:03
Message-ID: CAN6_MPp7Bmq2=fyfhv96OYCA56s_Gm-RQKfxut8cSkbcrwVnSA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

Thank you for the response.
Previously I had both java 8 and java 7 in my machine, the problem was
solved after making java 7 as the default java version.

Thanks!
Best Regards,

On Fri, Jan 30, 2015 at 9:37 AM, Pavithra Madurangi <pavithra@wso2.com>
wrote:

> Also please refer ESB Installation Prerequisites for more information
> 
> https://docs.wso2.com/display/ESB481/Installation+Prerequisites
> 
> On Fri, Jan 30, 2015 at 9:33 AM, Pavithra Madurangi <pavithra@wso2.com>
> wrote:
> 
> > As per [1], this happens when you've not installed JCE policy files
> > properly. So please make sure whether
> > 
> > - You've placed the two jar files @ $JAVA_HOME/jre/lib/security
> > - As per the special note in [1], "if you are running your client through
> > an IDE - and you still gets the above error after applying the provided
> > solution - double check the JAVA_HOME set in the corresponding IDE - and
> > need to patch that corresponding JDK"
> > Or if you are running curl commands from terminal try reloading .bashrc
> > 
> > [1]
> > http://blog.rampartfaq.com/2009/08/faq-001-javasecurityinvalidkeyexception.html
> > 
> > Regards,
> > Pavithra
> > 
> > On Wed, Jan 28, 2015 at 10:35 AM, Chathura Priyankara <chathurap@wso2.com
> > > wrote:
> > 
> > > Hi,
> > > 
> > > When I'm sending an encrypted request to the proxy service for the
> > > sample ESB configuration listed in [1], getting the following error from
> > > the AxisEngine. The java version I'm using is 1.7 so I used JCE for Java 7.
> > > Is this because of version mismatch of Java ?
> > > 
> > > ERROR engine.AxisEngine: The signature or decryption was invalid; nested
> > > exception is:
> > > org.apache.xml.security.encryption.XMLEncryptionException: Illegal key
> > > size
> > > Original Exception was java.security.InvalidKeyException: Illegal key
> > > size
> > > org.apache.axis2.AxisFault: The signature or decryption was invalid;
> > > nested exception is:
> > > org.apache.xml.security.encryption.XMLEncryptionException: Illegal key
> > > size
> > > Original Exception was java.security.InvalidKeyException: Illegal key
> > > size
> > > at
> > > org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:180)
> > >  at
> > > org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:95)
> > > at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
> > > at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
> > > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
> > > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
> > > at
> > > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
> > >  at
> > > org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:459)
> > >  at
> > > org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:279)
> > > at
> > > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
> > >  at
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> > > at
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> > > at java.lang.Thread.run(Thread.java:745)
> > > Caused by: org.apache.ws.security.WSSecurityException: The signature or
> > > decryption was invalid; nested exception is:
> > > org.apache.xml.security.encryption.XMLEncryptionException: Illegal key
> > > size
> > > Original Exception was java.security.InvalidKeyException: Illegal key
> > > size
> > > at
> > > org.apache.ws.security.processor.ReferenceListProcessor.decryptEncryptedData(ReferenceListProcessor.java:258)
> > >  at
> > > org.apache.ws.security.processor.EncryptedKeyProcessor.decryptDataRef(EncryptedKeyProcessor.java:483)
> > >  at
> > > org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:421)
> > >  at
> > > org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:119)
> > >  at
> > > org.apache.ws.security.processor.EncryptedKeyProcessor.handleToken(EncryptedKeyProcessor.java:95)
> > >  at
> > > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:332)
> > >  at
> > > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:249)
> > >  at org.apache.rampart.RampartEngine.process(RampartEngine.java:214)
> > > at
> > > org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)
> > > ... 11 more
> > > 
> > > [1]
> > > https://docs.wso2.com/display/ESB481/Sample+153%3A+Routing+Messages+that+Arrive+to+a+Proxy+Service+without+Processing+Security+Headers
> > >                 
> > > --
> > > Chathura Priyankara
> > > Software Engineer | WSO2 Inc.
> > > Mobile : +94718795340
> > > Blog : www.codeoncloud.blogspot.com
> > > 
> > > _______________________________________________
> > > Dev mailing list
> > > Dev@wso2.org
> > > http://wso2.org/cgi-bin/mailman/listinfo/dev
> > > 
> > > 
> > 
> > 
> > --
> > *Pavithra Madurangi*
> > Associate Technical Lead - QA.
> > WSO2 Inc.: http://wso2.com/
> > Mobile: 0777207357 / 0112747089
> > 
> 
> 
> 
> --
> *Pavithra Madurangi*
> Associate Technical Lead - QA.
> WSO2 Inc.: http://wso2.com/
> Mobile: 0777207357 / 0112747089
> 



-- 
Chathura Priyankara
Software Engineer | WSO2 Inc.
Mobile : +94718795340
Blog : www.codeoncloud.blogspot.com


[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>Thank you for the response.  \
</div><div>Previously I had both java 8 and java 7 in my machine, the problem was \
solved after making java 7 as the default java \
version.</div><div><br></div><div>Thanks!</div><div>Best Regards,</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 9:37 AM, \
Pavithra Madurangi <span dir="ltr">&lt;<a href="mailto:pavithra@wso2.com" \
target="_blank">pavithra@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Also please refer ESB Installation \
Prerequisites for more information</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div \
class="gmail_default"><font face="arial, helvetica, sans-serif"><a \
href="https://docs.wso2.com/display/ESB481/Installation+Prerequisites" \
target="_blank">https://docs.wso2.com/display/ESB481/Installation+Prerequisites</a></font><br></div></div><div \
class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div \
class="gmail_quote">On Fri, Jan 30, 2015 at 9:33 AM, Pavithra Madurangi <span \
dir="ltr">&lt;<a href="mailto:pavithra@wso2.com" \
target="_blank">pavithra@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">As per [1], this happens when \
you&#39;ve not installed  JCE policy files properly. So please make sure \
whether</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">- You&#39;ve placed the two jar files \
@ $JAVA_HOME/jre/lib/security</div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">- As per the special note in [1], \
&quot;if you are running your client through an IDE - and you still gets the above \
error after applying the provided solution - double check the JAVA_HOME set in the \
corresponding IDE - and need to patch that corresponding JDK&quot;</div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">Or if you are \
running curl commands from terminal try reloading .bashrc</div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">[1]  <a \
href="http://blog.rampartfaq.com/2009/08/faq-001-javasecurityinvalidkeyexception.html" \
target="_blank">http://blog.rampartfaq.com/2009/08/faq-001-javasecurityinvalidkeyexception.html</a></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Regards,</div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Pavithra</div></div><div \
class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Jan 28, 2015 at \
10:35 AM, Chathura Priyankara <span dir="ltr">&lt;<a href="mailto:chathurap@wso2.com" \
target="_blank">chathurap@wso2.com</a>&gt;</span> wrote:<br></div></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div><br></div><div>When I&#39;m \
sending an encrypted request to the proxy service for the sample ESB configuration \
listed in [1], getting the following error from the AxisEngine. The java version \
I&#39;m using is 1.7 so I used JCE for Java 7. Is this because of version mismatch of \
Java ?</div><div><br></div><div><div>ERROR engine.AxisEngine: The signature or \
decryption was invalid; nested exception is:  </div><div><span \
style="white-space:pre-wrap">	</span>org.apache.xml.security.encryption.XMLEncryptionException: \
Illegal key size</div><div>Original Exception was java.security.InvalidKeyException: \
Illegal key size</div><div>org.apache.axis2.AxisFault: The signature or decryption \
was invalid; nested exception is:  </div><div><span \
style="white-space:pre-wrap">	</span>org.apache.xml.security.encryption.XMLEncryptionException: \
Illegal key size</div><div>Original Exception was java.security.InvalidKeyException: \
Illegal key size</div><div><span style="white-space:pre-wrap">	</span>at \
org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:180)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:95)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.Phase.invoke(Phase.java:313)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:459)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:279)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)</div><div><span \
style="white-space:pre-wrap">	</span>at \
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</div><div><span \
style="white-space:pre-wrap">	</span>at \
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</div><div><span \
style="white-space:pre-wrap">	</span>at \
java.lang.Thread.run(Thread.java:745)</div><div>Caused by: \
org.apache.ws.security.WSSecurityException: The signature or decryption was invalid; \
nested exception is:  </div><div><span \
style="white-space:pre-wrap">	</span>org.apache.xml.security.encryption.XMLEncryptionException: \
Illegal key size</div><div>Original Exception was java.security.InvalidKeyException: \
Illegal key size</div><div><span style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.processor.ReferenceListProcessor.decryptEncryptedData(ReferenceListProcessor.java:258)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.processor.EncryptedKeyProcessor.decryptDataRef(EncryptedKeyProcessor.java:483)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:421)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:119)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.processor.EncryptedKeyProcessor.handleToken(EncryptedKeyProcessor.java:95)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:332)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:249)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.rampart.RampartEngine.process(RampartEngine.java:214)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)</div><div><span \
style="white-space:pre-wrap">	</span>... 11 more</div><div><br></div><div>[1]  <a \
href="https://docs.wso2.com/display/ESB481/Sample+153%3A+Routing+Messages+that+Arrive+to+a+Proxy+Service+without+Processing+Security+Headers" \
target="_blank">https://docs.wso2.com/display/ESB481/Sample+153%3A+Routing+Messages+th \
at+Arrive+to+a+Proxy+Service+without+Processing+Security+Headers</a></div><span><font \
color="#888888">-- <br><div><div dir="ltr"><div><div dir="ltr"><div><font \
color="#999999">Chathura Priyankara</font></div><div><font color="#999999">Software \
Engineer | WSO2 Inc.</font></div><div><font color="#999999">Mobile : <a \
href="tel:%2B94718795340" value="+94718795340" \
target="_blank">+94718795340</a></font></div><div><font color="#999999">Blog : <a \
href="http://www.codeoncloud.blogspot.com" \
target="_blank">www.codeoncloud.blogspot.com</a></font></div></div></div></div></div> \
</font></span></div></div> \
<br></div></div>_______________________________________________<br> Dev mailing \
list<br> <a href="mailto:Dev@wso2.org" target="_blank">Dev@wso2.org</a><br>
<a href="http://wso2.org/cgi-bin/mailman/listinfo/dev" \
target="_blank">http://wso2.org/cgi-bin/mailman/listinfo/dev</a><br> \
<br></blockquote></div><span><font color="#888888"><br><br \
clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><b>Pavithra \
Madurangi</b><br><span style="color:rgb(80,0,80)">Associate Technical Lead</span>  - \
QA.<br>WSO2 Inc.: <a href="http://wso2.com/" \
target="_blank">http://wso2.com/</a><br>Mobile: 0777207357 / \
0112747089<br></div></div></div></div> </font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div \
dir="ltr"><div><div dir="ltr"><b>Pavithra Madurangi</b><br><span \
style="color:rgb(80,0,80)">Associate Technical Lead</span>  - QA.<br>WSO2 Inc.: <a \
href="http://wso2.com/" target="_blank">http://wso2.com/</a><br>Mobile: 0777207357 / \
0112747089<br></div></div></div></div> </div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font \
color="#999999">Chathura Priyankara</font></div><div><font color="#999999">Software \
Engineer | WSO2 Inc.</font></div><div><font color="#999999">Mobile : \
+94718795340</font></div><div><font color="#999999">Blog : <a \
href="http://www.codeoncloud.blogspot.com" \
target="_blank">www.codeoncloud.blogspot.com</a></font></div></div></div></div></div> \
</div>



_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic