<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1957034268544385663</id><updated>2012-02-16T01:11:11.139-08:00</updated><category term='Advance'/><category term='Intermediate'/><category term='Basic'/><title type='text'>http://RampartFAQ.com</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2186873380727761407</id><published>2010-06-15T07:26:00.001-07:00</published><updated>2010-06-15T07:26:39.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to invoke a secured web service without maintaining a policy at the client side ?</title><content type='html'>&lt;a href="http://charithaka.blogspot.com/2010/02/how-to-invoke-secured-web-service.html"&gt;http://charithaka.blogspot.com/2010/02/how-to-invoke-secured-web-service.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2186873380727761407?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2186873380727761407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/06/how-to-invoke-secured-web-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2186873380727761407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2186873380727761407'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/06/how-to-invoke-secured-web-service.html' title='How to invoke a secured web service without maintaining a policy at the client side ?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7604081886172244856</id><published>2010-06-13T06:09:00.000-07:00</published><updated>2010-06-13T06:10:26.335-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>What are the required minimal jars to run an Axis2 client?</title><content type='html'>&lt;a href="http://amilachinthaka.blogspot.com/2009/11/minimal-jars-required-for-axis2-15.html"&gt;http://amilachinthaka.blogspot.com/2009/11/minimal-jars-required-for-axis2-15.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7604081886172244856?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7604081886172244856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/06/what-are-required-minimal-jars-to-run.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7604081886172244856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7604081886172244856'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/06/what-are-required-minimal-jars-to-run.html' title='What are the required minimal jars to run an Axis2 client?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4860160953002182085</id><published>2010-06-03T12:16:00.000-07:00</published><updated>2010-06-07T20:50:34.068-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to invoke a web service call with curl ?</title><content type='html'>If you are on Windows you can download the curl-7.19.5-win32-ssl-sspi.zip from &lt;a href="http://curl.haxx.se/latest.cgi?curl=win32-ssl-sspi"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can download the SimpleStockQuoteService.aar used in the example from &lt;a href="http://cache.facilelogin.com/SimpleStockQuoteService.aar"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;u&gt;SOAP Invocations&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;curl -d @request.xml -H "Content-Type: application/soap&lt;br /&gt;+xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The request.xml will look like following.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt;&lt;br /&gt;&amp;lt;soapenv:Body&gt;&lt;br /&gt;&amp;lt;getQuote xmlns="http://services.samples"&gt;&lt;br /&gt;&amp;lt;request&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;symbol xmlns="http://services.samples/xsd"&gt;IBM&amp;lt;/symbol&gt;&lt;br /&gt;&amp;lt;/request&gt;&lt;br /&gt;&amp;lt;/getQuote&gt;&lt;br /&gt;&amp;lt;/soapenv:Body&gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;u&gt;POX Invocations&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;curl -d @request.xml -H "Content-Type: application/xml" http://localhost:8080/axis2/services/SimpleStockQuoteService&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;*Notice that the Content-Type has changed.&lt;br /&gt;&lt;br /&gt;Now the request.xml will look like following.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;getQuote xmlns="http://services.samples"&gt;&lt;br /&gt;&amp;lt;request&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;symbol xmlns="http://services.samples/xsd"&gt;IBM&amp;lt;/symbol&gt;&lt;br /&gt;&amp;lt;/request&gt;&lt;br /&gt;&amp;lt;/getQuote&gt;&lt;/pre&gt;If you want to invoke a service with an HTTPS end point without trusting it's certificate authority - you can use the option "-k"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;curl -k -d @request.xml -H "Content-Type: application/xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4860160953002182085?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4860160953002182085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/06/how-to-invoke-web-service-call-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4860160953002182085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4860160953002182085'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/06/how-to-invoke-web-service-call-with.html' title='How to invoke a web service call with curl ?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-1558189319829653870</id><published>2010-05-07T18:52:00.000-07:00</published><updated>2010-05-07T18:58:07.209-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to cache Crypto objects in Rampart?</title><content type='html'>&lt;a href="http://www.mail-archive.com/rampart-dev@ws.apache.org/msg04375.html"&gt;http://www.mail-archive.com/rampart-dev@ws.apache.org/msg04375.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-1558189319829653870?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/1558189319829653870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/05/how-to-cache-crypto-objects-in-rampart.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1558189319829653870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1558189319829653870'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/05/how-to-cache-crypto-objects-in-rampart.html' title='How to cache Crypto objects in Rampart?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6695672233875042246</id><published>2010-05-07T03:59:00.000-07:00</published><updated>2010-05-07T04:07:37.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How does clustering affect the security context token with WS-SecureConversation?</title><content type='html'>Rampart keeps Token Storage in the Axis2 ConfigurationContext.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TokenStorage storage = (TokenStorage) configurationContext.getProperty(TokenStorage.TOKEN_STORAGE_KEY);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you use &lt;a href="http://wso2.org/downloads/wsas"&gt;WSAS&lt;/a&gt; [which is built on top of Axis2] to enable clustering, it replicates following three session data accross nodes.&lt;br /&gt;&lt;br /&gt;-ServiceContext: Data that should only be available to a service.&lt;br /&gt;-ServiceGroupContext: Common data for all the services in a service group.&lt;br /&gt;-ConfigurationContext: Common data for all the service groups&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wso2.org/library/tutorials/2010/03/do-clustering-wso2-wsas"&gt;This&lt;/a&gt; explains more about how to clustering with WSAS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6695672233875042246?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6695672233875042246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/05/how-does-clustering-affect-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6695672233875042246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6695672233875042246'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/05/how-does-clustering-affect-security.html' title='How does clustering affect the security context token with WS-SecureConversation?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8045929891396499173</id><published>2010-05-06T22:07:00.000-07:00</published><updated>2010-05-07T01:17:42.800-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>WS-Trust with SAML vs. WS-SecureConversation</title><content type='html'>WS-Trust builds on the framework provided by WS-Security, defining SOAP based mechanisms for brokering trust relationships, requesting and returning security tokens.&lt;br /&gt;&lt;br /&gt;WS-Security provides mechanisms for securing a single message in a one-way message exchange. Often interactions between a Web service and a consumer will result in multiple messages being exchanged. While each message could be secured in isolation, it is more efficient to establish some form of context that the Web service and consumer share and use that context to reduce the burden with respect to securing each message exchanged. WS-SecureConversation defines a Security Context Token [SCT] to perform this task.&lt;br /&gt;&lt;br /&gt;WS-SecureConversation defines three ways to establish the SCT.&lt;br /&gt;&lt;br /&gt;1. Security context token created by a security token service&lt;br /&gt;2. Security context token created by one of the communicating parties and propagated with a message&lt;br /&gt;3. Security context token created through negotiation/exchanges&lt;br /&gt;&lt;br /&gt;In [1] and [2] the initiator establishes the security context token (SCT) by using the WS-Trust protocol for session-based security with the recipient.After establishing the security context token, derived keys from the security context token are used to sign and encrypt the SOAP message to provide message-level protection.&lt;br /&gt;&lt;br /&gt;In [1], the context initiator asks a security token service to create a new security context token - based on WS-Trust.&lt;br /&gt;&lt;br /&gt;In [2], the initiator creates a security context token and sends&lt;br /&gt;it to the other parties on a message using the mechanisms described in this specification and in WS-Trust.&lt;br /&gt;&lt;br /&gt;Above explains all about the relationship between WS-Trust and WS-SecureConversation.&lt;br /&gt;&lt;br /&gt;In otherwords, WS-SecureConversation uses WS-Trust to establish the SCT.&lt;br /&gt;&lt;br /&gt;SAML is an XML-encoded framework for exchanging authentication, subject attribute and&lt;br /&gt;authorization information.&lt;br /&gt;&lt;br /&gt;Under the WS-Trust protocol we can add SAML Assertions under the wst:RequestedSecurityToken of the RSTR returned by the STS.&lt;br /&gt;&lt;br /&gt;When you use SAML is WS-Trust, that is for identity propagation - When we use WS-Trust with SecureConversation, that is for establishing a SCT.&lt;br /&gt;&lt;br /&gt;So, the question is when to use SAML with WS-Trust and when to use WS-Trust with SecureConversation.&lt;br /&gt;&lt;br /&gt;If relying party service requires user attributes [claims] in addition to the authentication - then we can use SAML with WS-Trust.&lt;br /&gt;&lt;br /&gt;If relying party service requires to establish an authenticated session with the client - then we can use SecureConversation with WS-Trust.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8045929891396499173?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8045929891396499173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2010/05/what-are-advantages-of-using-ws-trust.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8045929891396499173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8045929891396499173'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2010/05/what-are-advantages-of-using-ws-trust.html' title='WS-Trust with SAML vs. WS-SecureConversation'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7637533536665613007</id><published>2009-12-02T12:00:00.000-08:00</published><updated>2009-12-02T12:00:59.026-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to build rampart-config programmatically..</title><content type='html'>This &lt;a href="http://blog.thilinamb.com/2009/12/how-to-build-rampart-config.html"&gt;post&lt;/a&gt; explains, how to build the rampart-config programmatically at service consumer's end, without specifying it in policy file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7637533536665613007?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7637533536665613007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/12/how-to-build-rampart-config.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7637533536665613007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7637533536665613007'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/12/how-to-build-rampart-config.html' title='How to build rampart-config programmatically..'/><author><name>Thilina Mahesh Buddhika</name><uri>http://www.blogger.com/profile/04864625273456454963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_G2pEujy2-3M/S7Diva1oGfI/AAAAAAAAAJE/bWm_oy0521Y/s1600-R/afb359752be33bb80a1bb18c486ec5b3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2825230369082630996</id><published>2009-11-19T16:02:00.000-08:00</published><updated>2009-11-19T16:18:27.708-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to generate a non-secured response to a secured request?</title><content type='html'>In other words - how to avoid rampart being executed in the OutFlow of a particular service.&lt;br /&gt;&lt;br /&gt;1. Add a new phase [NoSecurity] in global axis2.xml under OutFlow - just before the Security phase&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;phaseOrder type="OutFlow"&amp;gt;&lt;br /&gt;        &amp;lt;phase name="soapmonitorPhase"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="OperationOutPhase"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="RMPhase"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="PolicyDetermination"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="MessageOut"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="NoSecurity"/&amp;gt;&lt;br /&gt;        &amp;lt;phase name="Security"/&amp;gt;&lt;br /&gt;&amp;lt;/phaseOrder&amp;gt;&lt;/pre&gt;2. Create a module [say, nosecuity] with handler having the following logic.&lt;pre name="code" class="java"&gt;&lt;br /&gt;public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {&lt;br /&gt;    msgContext.setCurrentHandlerIndex(msgContext.getCurrentHandlerIndex() + 2);&lt;br /&gt;    return InvocationResponse.CONTINUE;&lt;br /&gt;}&lt;/pre&gt;You can download the eclipse project for this module from &lt;a href="http://rampart.s3.amazonaws.com/no-security.rar"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. Engage this module to the service you want to remove security frome OutFlow.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;module ref="nosecurity" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2825230369082630996?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2825230369082630996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/11/how-to-generate-non-secure-response-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2825230369082630996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2825230369082630996'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/11/how-to-generate-non-secure-response-to.html' title='How to generate a non-secured response to a secured request?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8667115230115841575</id><published>2009-11-16T11:07:00.000-08:00</published><updated>2009-11-22T08:39:22.366-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to use Axis2 Dynamic Client to invoke Secured Web Services</title><content type='html'>Axis2 Dynamic Client is an extension to the Axis2 ServiceClient; it can be used to invoke secured web services relieving the burden of locally maintaining policy files in the client's end.&lt;br /&gt;This &lt;a href="http://blog.thilinamb.com/2009/11/using-axis2-dynamic-client-to-invoke.html"&gt;post&lt;/a&gt; explains how to use Axis2 Dynamic Client to invoke a secured service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8667115230115841575?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8667115230115841575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/11/how-to-use-axis2-dynamic-client-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8667115230115841575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8667115230115841575'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/11/how-to-use-axis2-dynamic-client-to.html' title='How to use Axis2 Dynamic Client to invoke Secured Web Services'/><author><name>Thilina Mahesh Buddhika</name><uri>http://www.blogger.com/profile/04864625273456454963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_G2pEujy2-3M/S7Diva1oGfI/AAAAAAAAAJE/bWm_oy0521Y/s1600-R/afb359752be33bb80a1bb18c486ec5b3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-1085770441235724109</id><published>2009-11-01T17:52:00.000-08:00</published><updated>2009-11-23T17:58:44.095-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>Exception in thread "main" java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/locks/ReadWriteLock</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt; [java] Exception in thread "main" org.apache.axis2.AxisFault: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/locks/ReadWriteLock&lt;br /&gt;[java]at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:435)&lt;br /&gt;[java]at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)&lt;br /&gt;[java]at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)&lt;br /&gt;[java]at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)&lt;br /&gt;[java]at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)&lt;br /&gt;&lt;/pre&gt;&lt;strong&gt;Solution :&lt;/strong&gt;Copy backport-util-concurrent jar from &lt;a href="http://sourceforge.net/projects/backport-jsr166/files/backport-jsr166/"&gt;here &lt;/a&gt;to the classpath.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-1085770441235724109?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/1085770441235724109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/11/exception-in-thread-main.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1085770441235724109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1085770441235724109'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/11/exception-in-thread-main.html' title='Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/locks/ReadWriteLock'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-1107224777403316238</id><published>2009-09-06T04:21:00.000-07:00</published><updated>2009-09-06T04:23:55.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to enable security for JAX-WS services with Axis2/Rampart?</title><content type='html'>1. &lt;a href="http://markmail.org/search/?q=list:org.apache.ws.axis-user+security#query:list%3Aorg.apache.ws.axis-user%20security%20from%3A%22Davanum%20Srinivas%22+page:1+mid:ovbomvbidripo7tq+state:results"&gt;What is the correct way to secure a JAX-WS service?&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://markmail.org/message/dkwjvskrh3gysvnw?q=list:org%2Eapache%2Ews%2Eaxis-user+can+I+use+use+rampart"&gt;Can I use use rampart with JAX-WS style webservice?&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-1107224777403316238?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/1107224777403316238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/09/how-to-enable-security-for-jax-ws.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1107224777403316238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1107224777403316238'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/09/how-to-enable-security-for-jax-ws.html' title='How to enable security for JAX-WS services with Axis2/Rampart?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2373177664577883912</id><published>2009-08-26T03:30:00.000-07:00</published><updated>2009-08-26T04:03:58.751-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>[ERROR] Referenced security token could not be retrieved (Reference "#CertId-238146")</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;[WARN] Multiple elements with the same 'Id' attribute value!&lt;br /&gt;[ERROR] Referenced security token could not be retrieved (Reference "#CertId-23&lt;br /&gt;146")&lt;br /&gt;org.apache.axis2.AxisFault: Referenced security token could not be retrieved (R&lt;br /&gt;ference "#CertId-238146")&lt;br /&gt;at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisF&lt;br /&gt;ult(RampartReceiver.java:166)&lt;br /&gt;at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.ja&lt;br /&gt;a:95)&lt;br /&gt;at org.apache.axis2.engine.Phase.invoke(Phase.java:317)&lt;br /&gt;at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;This can be due to many reasons - in the request where multiple elements having the same id.&lt;br /&gt;&lt;br /&gt;One scenario this happens is when you have security policy like following - with Rampart 1.4.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;sp:SupportingTokens&lt;br /&gt;xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;&lt;br /&gt;&amp;lt;wsp:Policy&gt;&lt;br /&gt;&amp;lt;sp:X509Token&lt;br /&gt;sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always"&gt;&lt;br /&gt;&amp;lt;wsp:Policy&gt;&lt;br /&gt;&amp;lt;sp:RequireThumbprintReference /&gt;&lt;br /&gt;&amp;lt;sp:WssX509V3Token10 /&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;br /&gt;&amp;lt;/sp:X509Token&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;br /&gt;&amp;lt;/sp:SupportingTokens&gt;&lt;/pre&gt;In this case Rampart 1.4 includes multiple &lt;strong&gt;BinarySecurityToken&lt;/strong&gt;(s) with duplicate wsu:Id.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Rampart 1.4 inherits the issue from wss4j-1.5.4.jar - replacing it with wss4j-1.5.8.jar will fix this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2373177664577883912?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2373177664577883912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/error-referenced-security-token-could.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2373177664577883912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2373177664577883912'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/error-referenced-security-token-could.html' title='[ERROR] Referenced security token could not be retrieved (Reference &quot;#CertId-238146&quot;)'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8433681632679806910</id><published>2009-08-25T13:28:00.000-07:00</published><updated>2009-08-25T13:47:59.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDING</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDING&lt;br /&gt;at javax.crypto.Cipher.getInstance(DashoA12275)&lt;br /&gt;at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:703)&lt;br /&gt;at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:145)&lt;br /&gt;at org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:114)&lt;br /&gt;&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;Bouncycastle jar may still in the classpath - but it's not picked as a crypto provider.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution 1:&lt;/strong&gt;&lt;br /&gt;Download the Bouncycastle jar corresponding to your JDK from &lt;a href="http://www.bouncycastle.org/latest_releases.html"&gt;here&lt;/a&gt; and copy it to [JAVA_HOME]\jre\lib\ext\&lt;br /&gt;&lt;br /&gt;Set following in [JAVA_HOME]\jre\lib\security\java.security  under;&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# List of providers and their preference orders (see above):&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt; security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution 2:&lt;/strong&gt;&lt;br /&gt;In code add Bouncycastle as a provider.&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;import java.security.Security;&lt;br /&gt;import org.bouncycastle.jce.provider.BouncyCastleProvider;&lt;br /&gt;&lt;br /&gt;Security.addProvider(new BouncyCastleProvider());&lt;/pre&gt;&lt;strong&gt;Related :&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://blog.rampartfaq.com/2009/08/orgapachewssecuritywssecurityexception.html"&gt;org.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8433681632679806910?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8433681632679806910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/javasecuritynosuchalgorithmexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8433681632679806910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8433681632679806910'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/javasecuritynosuchalgorithmexception.html' title='java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPPADDING'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6581076231482652907</id><published>2009-08-25T12:14:00.000-07:00</published><updated>2009-08-25T12:53:52.965-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>org.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;[java] Caused by: org.apache.ws.security.WSSecurityException:&lt;br /&gt;An unsupported signature or encryption algorithm was used (unsupported key transport encryption algorithm:&lt;br /&gt;No such algorithm: http://ww.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p)&lt;br /&gt;[java] at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:689)&lt;br /&gt;[java] at org.apache.ws.security.message.WSSecEncryptedKey.prepareInternal(WSSecEncryptedKey.java:195)&lt;br /&gt;[java] at org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:260)&lt;br /&gt;[java] at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:510)&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;Bouncycastle jar not found in the classpath.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Download the Bouncycastle jar corresponding to your JDK from &lt;a href="http://www.bouncycastle.org/latest_releases.html"&gt;here&lt;/a&gt; and add it to the classpath.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6581076231482652907?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6581076231482652907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapachewssecuritywssecurityexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6581076231482652907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6581076231482652907'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapachewssecuritywssecurityexception.html' title='org.apache.ws.security.WSSecurityException: An unsupported signature or encryption algorithm was used'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4551465787212688275</id><published>2009-08-25T00:36:00.000-07:00</published><updated>2009-08-26T18:29:11.361-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to add a secured and a non secured end point to the same service?</title><content type='html'>Here we want to let requests having no security headers to come to our service, and we handle it at the application logic by sending a customized response.&lt;br /&gt;&lt;br /&gt;If Rampart supports policy alternatives then this can be done easily. But Rampart does not.&lt;br /&gt;&lt;br /&gt;Anyway - there is way we could still do it - by applying different policies to different bindings.&lt;br /&gt;&lt;br /&gt;1.Add two different policies to the WSDL. For non-secured end point we use an empty policy as shown below.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsp:Policy &lt;br /&gt;xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" &lt;br /&gt;wsu:Id="NonSecure"&gt;&lt;br /&gt;&amp;lt;wsp:ExactlyOne&gt;&lt;br /&gt;&amp;lt;wsp:All /&gt;&lt;br /&gt;&amp;lt;/wsp:ExactlyOne&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;/pre&gt;2. Hand edit the WSDL and add a new binding element - which references the #NonSecure policy.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsdl:binding name="echoSoap12BindingNonsecured" type="ns:echoPortType"&gt;&lt;br /&gt;&amp;lt;wsp:PolicyReference URI="#NonSecure" /&gt; &lt;br /&gt;....&lt;br /&gt;&amp;lt;/wsdl:binding&gt;&lt;/pre&gt;3. Hand edit the WSDL and add a new &lt;strong&gt;wsdl:port&lt;/strong&gt; element - which references echoSoap12BindingNonsecured.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsdl:port name="echoHttpSoap12EndpointNonSecured" binding="ns:echoSoap12BindingNonsecured"&gt;&lt;br /&gt;&amp;lt;soap12:address location="http://localhost:8080/axis2/services/echo.echoHttpSoap12EndpointNonSecured/" /&gt;&lt;br /&gt;&amp;lt;/wsdl:port&gt;&lt;/pre&gt;4. You can find the modified wsdl from &lt;a href="http://ww2.wso2.org/~prabath/blog/25082009/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;5.Now edit your services.xml with appropriate &lt;strong&gt;wsp:PolicyAttachment&lt;/strong&gt;(s).&lt;br /&gt;&lt;br /&gt;6.Modify the services.xml to useOrignalWSDL.&lt;br /&gt;&lt;br /&gt;7.You can find the complete services.xml from &lt;a href="http://ww2.wso2.org/~prabath/blog/25082009/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;8.To invoke the secured end point use the EPR http://localhost:8080/axis2/services/echo.echoHttpSoap12Endpoint&lt;br /&gt;&lt;br /&gt;9.To invoke the non-secured end point use the EPR http://localhost:8080/axis2/services/echo.echoHttpSoap12EndpointNonSecured&lt;br /&gt;&lt;br /&gt;If you are not handling this type of a scenario properly at the application logic - then this is not a recommended approach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4551465787212688275?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4551465787212688275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-add-secured-and-non-secured-end.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4551465787212688275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4551465787212688275'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-add-secured-and-non-secured-end.html' title='How to add a secured and a non secured end point to the same service?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8262462727459228065</id><published>2009-08-24T18:44:00.000-07:00</published><updated>2009-08-24T18:47:30.340-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to run Rampart samples with Apache Tomcat?</title><content type='html'>&lt;a href="http://www.ruchith.org/"&gt;Ruchith&lt;/a&gt; explains &lt;a href="http://wso2.org/library/knowledge-base/run-rampart-samples-apache-tomcat"&gt;here&lt;/a&gt; how to setup and run standard Apache Rampart samples in an Axis2 instance hosted in Apache Rampart.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8262462727459228065?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8262462727459228065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-run-rampart-samples-with-apache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8262462727459228065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8262462727459228065'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-run-rampart-samples-with-apache.html' title='How to run Rampart samples with Apache Tomcat?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6610897023150961594</id><published>2009-08-24T04:23:00.000-07:00</published><updated>2009-08-24T04:33:05.295-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to configure Rampart in Axis2?</title><content type='html'>1.Download Axis2 distribution and extract locally.&lt;br /&gt;&lt;br /&gt;2.Download Rampart distribution and extract locally.&lt;br /&gt;&lt;br /&gt;3.Copy all the jars from [RAMPART_HOME]\lib to [AXIS2_HOME]\lib&lt;br /&gt;&lt;br /&gt;4.Copy rahas.mar and rampart.mar files from [RAMPART_HOME]\modules to [AXIS2_HOME]\repository\modules&lt;br /&gt;&lt;br /&gt;5. Now - engage rampart/rahas modules globally or at the service level. To engage globally use axis2.xml - at the service level use services.xml of the corresponding service.&lt;br /&gt;&lt;strong&gt;&amp;lt;module ref="rampart" /&gt;&lt;br /&gt;&amp;lt;module ref="rahas" /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6610897023150961594?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6610897023150961594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-configure-rampart-in-axis2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6610897023150961594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6610897023150961594'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-configure-rampart-in-axis2.html' title='How to configure Rampart in Axis2?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7218091343254437314</id><published>2009-08-24T01:49:00.000-07:00</published><updated>2009-08-24T03:49:54.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How Token referencing works in WS-Security?</title><content type='html'>Token referencing means how one token finds the other.&lt;br /&gt;&lt;br /&gt;For example digital signature and encryption operations require that a key be specified. For various reasons,the element containing the key in question may be located elsewhere in the message or completely outside the message.&lt;br /&gt;&lt;br /&gt;Let's first see an example where the key in question located inside the element it self.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;br /&gt;&amp;lt;ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;ds:X509Data&gt;&lt;br /&gt;&amp;lt;ds:X509Certificate&gt; &lt;br /&gt;MIICPjCCAacCBEngcUswDQYJKoZIhvcNAQEEBQAwZjELMAkGA1UEBhMCTEsxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxDTALBgNVBAoTBFdTTzIxDTALBgNVBAsTBE5vbmUxEjA&lt;br /&gt;&amp;lt;/ds:X509Certificate&gt;&lt;br /&gt;&amp;lt;/ds:X509Data&gt;&lt;br /&gt;&amp;lt;/ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;/ds:Signature&gt;&lt;/pre&gt;If you take the KeyInfo element out from the above example you'll see - the public key corresponding to the Signature being included inside the Signature element it self.&lt;br /&gt;&lt;br /&gt;Let's take another example.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;br /&gt;&amp;lt;ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;wsse:SecurityTokenReference&lt;br /&gt;xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;br /&gt;&amp;lt;wsse:KeyIdentifier&lt;br /&gt;EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" &lt;br /&gt;ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"&gt;&lt;br /&gt;NC+OYE+VLHQQCmJL3DVRkUyxrr0=&lt;br /&gt;&amp;lt;/wsse:KeyIdentifier&gt;&lt;br /&gt;&amp;lt;/wsse:SecurityTokenReference&gt;&lt;br /&gt;&amp;lt;/ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;/ds:Signature&gt;&lt;/pre&gt;Have a look at &lt;strong&gt;wsse:SecurityTokenReference&lt;/strong&gt; element.&lt;br /&gt;&lt;br /&gt;Here it contains the thumbprint [http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1] value of the certificate being used to sign.&lt;br /&gt;&lt;br /&gt;In this case - to validate the signature, you need to have the correponding certificate in your key store, at the receipient end.&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;wsse:SecurityTokenReference&lt;/strong&gt; element provides an open content model for referencing key bearing elements because not all of them support a common reference pattern. Similarly, some have closed schemas and define their own reference mechanisms. The open content model allows appropriate reference mechanisms to be used.&lt;br /&gt;&lt;br /&gt;If a &lt;strong&gt;wsse:SecurityTokenReference&lt;/strong&gt; is used outside of the security header processing block the meaning of the response and/or processing rules of the resulting references MUST be specified by the the specific profile.&lt;br /&gt;&lt;br /&gt;Let's take another example.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;br /&gt;&amp;lt;ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;wsse:SecurityTokenReference &lt;br /&gt;xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;br /&gt;&amp;lt;wsse:Reference &lt;br /&gt;URI="#CertId-33F15B961A92D5966C12511059451031" &lt;br /&gt;ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" /&gt;&lt;br /&gt;&amp;lt;/wsse:SecurityTokenReference&gt;&lt;br /&gt;&amp;lt;/ds:KeyInfo&gt;&lt;br /&gt;&amp;lt;/ds:Signature&gt;&lt;/pre&gt;Here, have a look at &lt;strong&gt;wsse:Reference&lt;/strong&gt; and it's attribute &lt;strong&gt;URI&lt;/strong&gt;. Also notice that the value of &lt;strong&gt;URI&lt;/strong&gt; starts with a '&lt;strong&gt;#&lt;/strong&gt;' - that means, this refers to a token that should be found within the message it self.&lt;br /&gt;&lt;br /&gt;In other words - the message should have an element with the &lt;strong&gt;wsu:Id&lt;/strong&gt; CertId-33F15B961A92D5966C12511059451031 [ommiting &lt;strong&gt;#&lt;/strong&gt;].&lt;br /&gt;&lt;br /&gt;In our case - the token reffered is included in the message it self as a BinarySecurityToken.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsse:BinarySecurityToken&lt;br /&gt;xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&lt;br /&gt;EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&lt;br /&gt;ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"&lt;br /&gt;wsu:Id="CertId-33F15B961A92D5966C12511059451031"&gt;&lt;br /&gt;MIIC0TCCAbkCBEp6Up4wDQYJKoZIhvcNAQEEBQAwLTELMAkGAUEBhMCTEsxDTALBgNVBAsMBHdzbzIxDzANBgNVBAMMBmNsaWVudDAeFw0wOTA4MDYwMzQ4NDZaFw0xMjA4MDUwMzQ4NDZaMC0xCzAJBgNVBAYTAkxLMQ0wCwYDVQQLDAR3c28yMQ8wDQYDVQQDDAZjbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCAMXusC&amp;lt;wsse:BinarySecurityToken&gt;&lt;/pre&gt;Let's get in to theory a bit.&lt;br /&gt;&lt;br /&gt;The following list provides a list of the specific reference mechanisms defined in WSS: SOAP Message Security in preferred order (i.e., most specific to least specific):&lt;br /&gt;&lt;br /&gt;• Direct References – This allows references to included tokens using URI fragments and external tokens using full URIs.&lt;br /&gt;• Key Identifiers – This allows tokens to be referenced using an opaque value that represents the token (defined by token type/profile).&lt;br /&gt;• Key Names – This allows tokens to be referenced using a string that matches an identity assertion within the security token. This is a subset match and may result in multiple security tokens that match the specified name.&lt;br /&gt;• Embedded References - This allows tokens to be embedded (as opposed to a pointer to a token that resides elsewhere).&lt;br /&gt;&lt;br /&gt;In the samples provided before; the second example is for "Key Identifiers" and the third is for "Direct References".&lt;br /&gt;&lt;br /&gt;Now, let's see an example of &lt;strong&gt;Embedded References&lt;/strong&gt;.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsse:SecurityTokenReference&gt;&lt;br /&gt;&amp;lt;wsse:Embedded wsu:Id="tok1"&gt;&lt;br /&gt;&amp;lt;saml:Assertion xmlns:saml="..."&gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;saml:Assertion&gt;&lt;br /&gt;&amp;lt;/wsse:Embedded&gt;&lt;br /&gt;&amp;lt;/wsse:SecurityTokenReference&gt;&lt;/pre&gt;Following is an example of &lt;strong&gt;Key Names&lt;/strong&gt;.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ds:KeyInfo Id="..." xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;br /&gt;&amp;lt;ds:KeyName&gt;CN=Hiroshi Maruyama, C=JP&amp;lt;/ds:KeyName&gt;&lt;br /&gt;&amp;lt;/ds:KeyInfo&gt;&lt;/pre&gt;It is strongly RECOMMENDED to use &lt;strong&gt;wsse:KeyIdentifier&lt;/strong&gt; elements. However, if &lt;strong&gt;Key Names&lt;/strong&gt; are used, then it is strongly RECOMMENDED that &lt;strong&gt;ds:KeyName&lt;/strong&gt; elements conform to the attribute names in section 2.3 of RFC 2253 (this is recommended by XML Signature for &lt;strong&gt;ds:X509SubjectName&lt;/strong&gt;, for interoperability.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7218091343254437314?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7218091343254437314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-token-referencing-works-in-ws.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7218091343254437314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7218091343254437314'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-token-referencing-works-in-ws.html' title='How Token referencing works in WS-Security?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-5928641249027939113</id><published>2009-08-23T18:19:00.000-07:00</published><updated>2009-08-23T18:49:44.666-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>What are policy subjects and where goes security policy assertions?</title><content type='html'>The entities with which policies are associated are called policy subjects.&lt;br /&gt;&lt;br /&gt;For example, you can associate a policy with an endpoint, in which case the endpoint is the policy subject. It is possible to associate multiple policies with any given policy subject. The WS-Policy framework supports the following kinds of policy subject.&lt;br /&gt;&lt;br /&gt;•Service policy subject.&lt;br /&gt;&lt;br /&gt;•Endpoint policy subject.&lt;br /&gt;&lt;br /&gt;•Operation policy subject.&lt;br /&gt;&lt;br /&gt;•Message policy subject.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Service policy subject&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Associates a policy with a service, insert either a &lt;wsp:Policy&gt; element or a &lt;wsp:PolicyReference&gt; element as a sub-element of the following WSDL 1.1 element(s):&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:service&lt;/strong&gt; — apply the policy to all of the ports (endpoints) offered by this service.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Endpoint policy subject&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Associates a policy with an endpoint, insert either a &lt;wsp:Policy&gt; element or a &lt;wsp:PolicyReference&gt; element as a sub-element of any of the following WSDL 1.1 elements:&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:portType&lt;/strong&gt; — apply the policy to all of the ports (endpoints) that use this port type.&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:binding&lt;/strong&gt; — apply the policy to all of the ports that use this binding.&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:port&lt;/strong&gt; — apply the policy to this endpoint only.&lt;br /&gt;&lt;br /&gt;wsdl:service can have multiple wsdl:port(s) and a given wsdl:port has reference to a single wsdl:binding, while wsdl:binding has reference to a wsdl:portType.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Operation policy subject&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Associate a policy with an operation, insert either a &lt;wsp:Policy&gt; element or a &lt;wsp:PolicyReference&gt; element as a sub-element of any of the following WSDL 1.1 elements:&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:portType/wsdl:operation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;•wsdl:binding/wsdl:operation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Message policy subject&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Associate a policy with a message, insert either a &lt;wsp:Policy&gt; element or a &lt;wsp:PolicyReference&gt; element as a sub-element of any of the following WSDL 1.1 elements:&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:message&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:portType/wsdl:operation/wsdl:input&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:portType/wsdl:operation/wsdl:output&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:portType/wsdl:operation/wsdl:fault&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:binding/wsdl:operation/wsdl:input&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:binding/wsdl:operation/wsdl:output&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;•&lt;strong&gt;wsdl:binding/wsdl:operation/wsdl:fault&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Following are the policy assertions and their corresponding policy subjects as per the WS-Security Policy.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Endpoint Policy Subject Assertions&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;strong&gt;Security Binding Assertions&lt;/strong&gt;&lt;br /&gt;TransportBinding Assertion&lt;br /&gt;SymmetricBinding Assertion&lt;br /&gt;AsymmetricBinding Assertion&lt;br /&gt;&lt;br /&gt;2) &lt;strong&gt;Token Assertions&lt;/strong&gt;&lt;br /&gt;SupportingTokens Assertion&lt;br /&gt;SignedSupportingTokens Assertion&lt;br /&gt;EndorsingSupportingTokens Assertion&lt;br /&gt;SignedEndorsingSupportingTokens Assertion&lt;br /&gt;&lt;br /&gt;3) &lt;strong&gt;WSS: SOAP Message Security 1.0 Assertions&lt;/strong&gt;&lt;br /&gt;Wss10 Assertion&lt;br /&gt;&lt;br /&gt;4) &lt;strong&gt;WSS: SOAP Message Security 1.1 Assertions&lt;/strong&gt;&lt;br /&gt;Wss11 Assertion&lt;br /&gt;&lt;br /&gt;5) &lt;strong&gt;Trust 1.0 Assertions&lt;/strong&gt;&lt;br /&gt;Trust10 Assertion&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Operation Policy Subject Assertions&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;strong&gt;Supporting Token Assertions&lt;/strong&gt;&lt;br /&gt;SupportingTokens Assertion&lt;br /&gt;SignedSupportingTokens Assertion&lt;br /&gt;EndorsingSupportingTokens Assertion&lt;br /&gt;SignedEndorsingSupportingTokens Assertion&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Message Policy Subject Assertions&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1) &lt;strong&gt;Supporting Token Assertions&lt;/strong&gt;&lt;br /&gt;SupportingTokens Assertion&lt;br /&gt;SignedSupportingTokens Assertion&lt;br /&gt;EndorsingSupportingTokens Assertion&lt;br /&gt;SignedEndorsingSupportingTokens Assertion&lt;br /&gt;&lt;br /&gt;2) &lt;strong&gt;Protection Assertions&lt;/strong&gt;&lt;br /&gt;SignedParts Assertion&lt;br /&gt;SignedElements Assertion&lt;br /&gt;EncryptedParts Assertion&lt;br /&gt;EncryptedElements Assertion&lt;br /&gt;RequiredElements Assertion&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-5928641249027939113?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/5928641249027939113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-are-policy-subjects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5928641249027939113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5928641249027939113'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-are-policy-subjects.html' title='What are policy subjects and where goes security policy assertions?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-3030128828087835436</id><published>2009-08-23T08:18:00.000-07:00</published><updated>2009-08-23T08:21:25.614-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How password Callback Handlers work in Rampart?</title><content type='html'>In &lt;a href="http://wso2.org/library/3733"&gt;this&lt;/a&gt; article &lt;a href="http://nandana83.blogspot.com/"&gt;Nandana&lt;/a&gt; nicely explains the usage of password callback handlers in Rampart.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-3030128828087835436?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/3030128828087835436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-password-callback-handlers-work-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3030128828087835436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3030128828087835436'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-password-callback-handlers-work-in.html' title='How password Callback Handlers work in Rampart?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4702126631312082966</id><published>2009-08-23T07:22:00.000-07:00</published><updated>2009-08-23T07:55:39.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to do proxy authenticaion at runtime - in Axis2 client or stub?</title><content type='html'>&lt;pre name="code" class="java"&gt;&lt;br /&gt;HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties().new ProxyProperties();&lt;br /&gt;proxyProperties.setProxyHostName("axis2");&lt;br /&gt;proxyProperties.setProxyPort(9762);&lt;br /&gt;proxyproperties.setDomain("axis2/anon");&lt;br /&gt;proxyproperties.setPassWord("passwd");&lt;br /&gt;proxyproperties.setUserName("usernm");&lt;br /&gt;//in order to makesure that we use HTTP 1.0&lt;br /&gt;options.setProperty(MessageContextConstants.HTTP_PROTOCOL_VERSION,HTTPConstants.HEADER_PROTOCOL_10);&lt;br /&gt;options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,proxyProperties);&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4702126631312082966?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4702126631312082966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-do-proxy-authenticaion-at.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4702126631312082966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4702126631312082966'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-do-proxy-authenticaion-at.html' title='How to do proxy authenticaion at runtime - in Axis2 client or stub?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-3002075831521347778</id><published>2009-08-22T21:59:00.000-07:00</published><updated>2009-08-23T07:40:43.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>What are the Rampart handlers in inflow and what do they do?</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_SCehs1bQNGw/SpDOdWSjg1I/AAAAAAAAAAw/gQ7-lMiRlhQ/s1600-h/rampart-inflow.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 146px;" src="http://3.bp.blogspot.com/_SCehs1bQNGw/SpDOdWSjg1I/AAAAAAAAAAw/gQ7-lMiRlhQ/s400/rampart-inflow.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5373021359047934802" /&gt;&lt;/a&gt;&lt;u&gt;&lt;strong&gt;org.apache.rampart.handler.RampartReceiver&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. The first point of impact with the Axis2 Security layer&lt;br /&gt;&lt;br /&gt;2. Validates the transports - that is if policy requires TransportBinding with HTTPS - then incoming transport should be on HTTPS, also if TransportBinding requires client auth - then the initiator should present a X.509 certificate with the request.&lt;br /&gt;&lt;br /&gt;3. If no security header present in the request - this will throw a RampartException for missing security header.&lt;br /&gt;&lt;br /&gt;4. Processes the security header&lt;br /&gt;&lt;br /&gt;5. Elements inside security header are processed according to the order they found in side the request - or the security header.&lt;br /&gt;&lt;br /&gt;6. Each element defined under security header will have a processor [org.apache.ws.security.processor.Processor] associate with it corresponding to the token type. &lt;br /&gt;&lt;br /&gt;7. Processing of the entire security header builds up a Vector. Each element in the Vector represents the result of a security action. The elements are ordered according to the sequence of the security actions in the wsse:Signature header. The Vector may be empty if no security processing was performed.&lt;br /&gt;&lt;br /&gt;8. Now - validates the incoming message against the defined security policy.[You may also check &lt;a href="http://blog.rampartfaq.com/2009/08/can-we-have-per-service-policy-based.html"&gt;this &lt;/a&gt;out...]&lt;br /&gt;&lt;br /&gt;9. Marks the security header block as processed.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;org.apache.rampart.handler.WSDoAllReceiver&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. There are two ways Rampart supports security processing - one is policy based security processing as per WS-Security Policy, the other is parameter based security processing.&lt;br /&gt;&lt;br /&gt;2. Parameter based security processing is deprecated in Rampart, hence the WSDoAllReceiver handler which supports parameter based security processing is also deprecated.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;org.apache.rampart.handler.PostDispatchVerificationHandler&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. Handler to verify the message security after dispatch.&lt;br /&gt;&lt;br /&gt;2. Checks whether security is required and it's being processed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-3002075831521347778?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/3002075831521347778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-are-rampart-handlers-in-inflow-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3002075831521347778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3002075831521347778'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-are-rampart-handlers-in-inflow-and.html' title='What are the Rampart handlers in inflow and what do they do?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SCehs1bQNGw/SpDOdWSjg1I/AAAAAAAAAAw/gQ7-lMiRlhQ/s72-c/rampart-inflow.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-1652466423165434995</id><published>2009-08-22T11:17:00.000-07:00</published><updated>2009-08-23T07:41:24.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How does the nonce and the timestamp get generated for hashed passwords in UsernameToken?</title><content type='html'>We need not to worry about the digest calculation in our application code - we simply need to set the password type to #PasswordDigest [or set the policy correctly as explained &lt;a href="http://blog.rampartfaq.com/2009/08/how-to-ask-for-hashed-password-in.html"&gt;here&lt;/a&gt;] and supply the password in clear text from the password callback handler.&lt;br /&gt;&lt;br /&gt;Inside wss4j code; will take the password in clear text and do the digest verification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-1652466423165434995?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/1652466423165434995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-does-nonce-and-timestamp-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1652466423165434995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/1652466423165434995'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-does-nonce-and-timestamp-get.html' title='How does the nonce and the timestamp get generated for hashed passwords in UsernameToken?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-3681417176481182722</id><published>2009-08-22T10:34:00.000-07:00</published><updated>2009-08-23T07:41:39.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to ask for a hashed password in security policy?</title><content type='html'>Under WS-Security Policy we can specify the requirement for a UsernameToken as following.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;&lt;br /&gt;&amp;lt;wsp:Policy&gt;&lt;br /&gt;&amp;lt;sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"/&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;br /&gt;&amp;lt;/sp:SupportingTokens&gt;&lt;/pre&gt;In this case UsernameToken will be included in the request [SOAP message] as below.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-2"&gt;&lt;br /&gt;&amp;lt;wsse:Username&gt;alice&amp;lt;/wsse:Username&gt;&lt;br /&gt;&amp;lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;bobPW&amp;lt;/wsse:Password&gt;&lt;br /&gt;&amp;lt;/wsse:UsernameToken&gt;&lt;/pre&gt;Here the password will be included in clear text. But if we want the password to be included as a digest value[...#PasswordDigest]then the security policy should look like...&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;&lt;br /&gt;&amp;lt;wsp:Policy&gt;&lt;br /&gt;&amp;lt;sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"&gt;&lt;br /&gt;&amp;lt;wsp:Policy&gt;&lt;br /&gt;&amp;lt;sp:HashPassword/&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;br /&gt;&amp;lt;/sp:UsernameToken&gt;&lt;br /&gt;&amp;lt;/wsp:Policy&gt;&lt;br /&gt;&amp;lt;/sp:SupportingTokens&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-3681417176481182722?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/3681417176481182722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-ask-for-hashed-password-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3681417176481182722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3681417176481182722'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-ask-for-hashed-password-in.html' title='How to ask for a hashed password in security policy?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4513265408382676129</id><published>2009-08-21T10:51:00.000-07:00</published><updated>2009-11-22T08:40:37.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How identity delegation works with ActAs in WS-Trust 1.4?</title><content type='html'>In this &lt;a href="http://blog.thilinamb.com/2009/08/identity-delegation-in-ws-trust-14.html"&gt;post&lt;/a&gt;, I explain about the "ActAs" element which is a new addition to the &lt;a href="http://docs.oasis-open.org/ws-sx/ws-trust/v1.4/os/ws-trust-1.4-spec-os.html"&gt;WS-Trust specification&lt;/a&gt; since its version 1.4.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4513265408382676129?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4513265408382676129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-delegate-identity-using-actas-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4513265408382676129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4513265408382676129'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-delegate-identity-using-actas-in.html' title='How identity delegation works with ActAs in WS-Trust 1.4?'/><author><name>Thilina Mahesh Buddhika</name><uri>http://www.blogger.com/profile/04864625273456454963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_G2pEujy2-3M/S7Diva1oGfI/AAAAAAAAAJE/bWm_oy0521Y/s1600-R/afb359752be33bb80a1bb18c486ec5b3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7888596620148231844</id><published>2009-08-21T07:28:00.000-07:00</published><updated>2009-08-23T07:39:12.019-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to enable NTLM authentication in Axis2 client?</title><content type='html'>&lt;pre name="code" class="java"&gt;&lt;br /&gt;HttpTransportProperties.NTLMAuthentication ntlmAuthentication = new HttpTransportProperties().new NTLMAuthentication();&lt;br /&gt;ntlmAuthentication.setUsername("axis2");&lt;br /&gt;ntlmAuthentication.setPassword("axis2");&lt;br /&gt;ntlmAuthentication.setHost("axis2");&lt;br /&gt;ntlmAuthentication.setPort(9443);&lt;br /&gt;ntlmAuthentication.setRealm("someRealm");&lt;br /&gt;options.setProperty(org.apache.axis2.transport.http.HTTPConstants.NTLM_AUTHENTICATION,ntlmAuthentication);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7888596620148231844?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7888596620148231844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ntlm-authentication-in.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7888596620148231844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7888596620148231844'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ntlm-authentication-in.html' title='How to enable NTLM authentication in Axis2 client?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8724202616345313154</id><published>2009-08-20T13:08:00.000-07:00</published><updated>2009-11-22T08:41:37.283-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How SOAP message encryption works?</title><content type='html'>In this &lt;a href="http://blog.thilinamb.com/2009/08/how-does-soap-message-encryption-work.html"&gt;post&lt;/a&gt;, I am explaining how the SOAP message encryption works as defined in the &lt;a href="http://www.oasis-open.org/committees/download.php/16790/wss-v1.1-spec-os-SOAPMessageSecurity.pdf"&gt;WS Security Specification&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8724202616345313154?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8724202616345313154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-does-soap-message-encryption-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8724202616345313154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8724202616345313154'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-does-soap-message-encryption-work.html' title='How SOAP message encryption works?'/><author><name>Thilina Mahesh Buddhika</name><uri>http://www.blogger.com/profile/04864625273456454963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://4.bp.blogspot.com/_G2pEujy2-3M/S7Diva1oGfI/AAAAAAAAAJE/bWm_oy0521Y/s1600-R/afb359752be33bb80a1bb18c486ec5b3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8672110951244323901</id><published>2009-08-19T18:14:00.000-07:00</published><updated>2009-08-23T07:42:21.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>What is Assymetric Binding?</title><content type='html'>In &lt;a href="http://thilinamb.wordpress.com/2009/08/19/ws-security-policy-assymetric-binding-explained/"&gt;this&lt;/a&gt; blog post, &lt;a href="http://thilinamb.wordpress.com"&gt;Thilina&lt;/a&gt; explains the Assymetric Binding defined in WS Security Policy Specification and also provides a working example with Axis2/Rampart.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8672110951244323901?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8672110951244323901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-is-assymetric-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8672110951244323901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8672110951244323901'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-is-assymetric-binding.html' title='What is Assymetric Binding?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7104802786805898432</id><published>2009-08-19T09:42:00.000-07:00</published><updated>2009-08-23T07:42:43.358-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>Can we avoid duplicating crypto info added to RampartConfig in different services.xml files?</title><content type='html'>When we have Signature and/or Encryption in a security policy - we need to add following crypto info into the RampartConfig.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt;&lt;br /&gt;&amp;lt;ramp:user&gt;service&amp;lt;/ramp:user&gt;&lt;br /&gt;&amp;lt;ramp:encryptionUser&gt;client&amp;lt;/ramp:encryptionUser&gt;&lt;br /&gt;&amp;lt;ramp:passwordCallbackClass&gt;sample03.PWCBHandler&amp;lt;/ramp:passwordCallbackClass&gt;&lt;br /&gt;&amp;lt;ramp:signatureCrypto&gt;&lt;br /&gt;&amp;lt;ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type"&gt;JKS&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.file"&gt;service.jks&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password"&gt;apache&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;/ramp:crypto&gt;&lt;br /&gt;&amp;lt;/ramp:signatureCrypto&gt;&lt;br /&gt;&amp;lt;ramp:encryptionCypto&gt;&lt;br /&gt;&amp;lt;ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type"&gt;JKS&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.file"&gt;service.jks&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password"&gt;apache&amp;lt;/ramp:property&gt;&lt;br /&gt;&amp;lt;/ramp:crypto&gt;&lt;br /&gt;&amp;lt;/ramp:encryptionCypto&gt;&lt;br /&gt;&amp;lt;/ramp:RampartConfig&gt;&lt;/pre&gt;In most of the cases above settings are static for more than one service.&lt;br /&gt;&lt;br /&gt;In such a case - you can avoid adding this configuration to each and every service.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step - 1&lt;/strong&gt;&lt;br /&gt;Implement the interface org.apache.rampart.RampartConfigCallbackHandler&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step - 2&lt;/strong&gt;&lt;br /&gt;In the RampartConfigCallbackHandler implementation update the RampartConfig instance passed into the method update() programmetically.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step - 3&lt;/strong&gt;&lt;br /&gt;Add following to the service policy of all the corresponding services.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt; &lt;br /&gt;&amp;lt;ramp:rampartConfigCallbackClass&gt;RampartConfigCallbackHandlerImpl&lt;/ramp:rampartConfigCallbackClass&gt;&lt;br /&gt;&amp;lt;/ramp:RampartConfig&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7104802786805898432?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7104802786805898432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-avoid-duplicating-crypto-info.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7104802786805898432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7104802786805898432'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-avoid-duplicating-crypto-info.html' title='Can we avoid duplicating crypto info added to RampartConfig in different services.xml files?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-5726301976461957022</id><published>2009-08-19T07:16:00.000-07:00</published><updated>2009-08-23T07:43:00.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to apply policies at binding hierarchy?</title><content type='html'>In &lt;a href="http://wso2.org/library/3786"&gt;this&lt;/a&gt; article &lt;a href="http://nandana83.blogspot.com/"&gt;Nandana&lt;/a&gt; explains how to apply policies at binding hierarchy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-5726301976461957022?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/5726301976461957022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-apply-policies-at-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5726301976461957022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5726301976461957022'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-apply-policies-at-binding.html' title='How to apply policies at binding hierarchy?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8103306614513068073</id><published>2009-08-19T07:00:00.000-07:00</published><updated>2009-08-23T07:43:19.305-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>Can we have per service, policy based results validators?</title><content type='html'>Yes... you can.&lt;br /&gt;&lt;br /&gt;You need to implement &lt;strong&gt;org.apache.rampart.PolicyValidatorCallbackHandler&lt;/strong&gt; interface and add the following configuration to your service policy - RampartConfig.&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;ramp:policyValidatorCbClass&gt;my.CustomPolicyValidator&amp;lt;/ramp:policyValidatorCbClass&gt;&lt;br /&gt;&amp;lt;/ramp:RampartConfig&gt;&lt;/pre&gt;This PolicyValidatorCallbackHandler interface allows different implementations of policy based results validation. Default implementation is &lt;strong&gt;org.apache.rampart.PolicyBasedResultsValidator&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;It's always recommended that you use the default PolicyBasedResultsValidator - if you do not have a very specific custom requirement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8103306614513068073?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8103306614513068073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-have-per-service-policy-based.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8103306614513068073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8103306614513068073'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-have-per-service-policy-based.html' title='Can we have per service, policy based results validators?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2909789440973769906</id><published>2009-08-19T06:47:00.000-07:00</published><updated>2009-08-23T07:43:55.521-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>Would timestamp validation fail when servers and clients running in different timezones?</title><content type='html'>No. WSS4J keeps the time as UTC - so different timezones shouldn't matter. &lt;br /&gt;&lt;br /&gt;Even in different timezones - if you have the correct time corresponding to that time zone - then it should be fine. &lt;br /&gt;&lt;br /&gt;For example : &lt;br /&gt;&lt;br /&gt;Time Zone A [GMT + 8] : Correct Time Now : 4.00 AM &lt;br /&gt;&lt;br /&gt;Time Zone B [GMT + 11] : Correct Time Now : 7.00 AM &lt;br /&gt;&lt;br /&gt;Then it should work with no issues. &lt;br /&gt;&lt;br /&gt;But in the same case if you have the time, incorrectly, in Time Zone A as 5.00 AM [ in a case where it should be ideally 4 .00 AM] - then timestamp validation will fail. &lt;br /&gt;&lt;br /&gt;So - timezone wouldn't be an issue if we still have the correct time in each case corresponding to the timezone - it belongs to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2909789440973769906?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2909789440973769906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/would-timestamp-validation-fail-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2909789440973769906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2909789440973769906'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/would-timestamp-validation-fail-when.html' title='Would timestamp validation fail when servers and clients running in different timezones?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4488377804074330809</id><published>2009-08-18T10:45:00.000-07:00</published><updated>2009-08-23T07:44:18.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to secure a web service with UsernameToken + HTTPS?</title><content type='html'>In this &lt;a href="http://thilinamb.wordpress.com/2009/08/18/securing-a-web-service-with-username-token-https-with-apache-rampart/"&gt;blog post&lt;/a&gt; &lt;a href="http://thilinamb.wordpress.com"&gt;Thilina&lt;/a&gt; nicely explains how to secure a given web service with UsernameToken.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4488377804074330809?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4488377804074330809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-service-with_18.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4488377804074330809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4488377804074330809'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-service-with_18.html' title='How to secure a web service with UsernameToken + HTTPS?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6356681122544789610</id><published>2009-08-18T08:51:00.000-07:00</published><updated>2009-08-25T12:52:54.152-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>org.apache.rampart.RampartException: The timestamp could not be validated</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;Caused by: org.apache.rampart.RampartException: The timestamp could not be validated&lt;br /&gt;at org.apache.rampart.PolicyBasedResultsValidator.validat(PolicyBasedResultsValidator.java:188)&lt;br /&gt;at org.apache.rampart.RampartEngine.process(RampartEngine.java:214)&lt;br /&gt;at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;This could be either due to the server clock not in sync with the client clock or the transmission delay goes beyond the accepted TTL.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Add the following to the RampartConfig in the policy file appropriately.&lt;br /&gt;&lt;br /&gt;&amp;lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;ramp:timestampTTL&gt;600&amp;lt;/ramp:timestampTTL&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;ramp:timestampMaxSkew&gt;600&amp;lt;/ramp:timestampMaxSkew&gt; &lt;br /&gt;&amp;lt;ramp:RampartConfig&gt;&lt;br /&gt;&lt;br /&gt;The value must be the time skew /ttl in seconds and must be specified as an integer. By default Apache Rampart/Java tolarates a maximum time skew / ttl of five (5) minutes (300 seconds).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explanation :&lt;/strong&gt;&lt;br /&gt;For the timestamp to be validated;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;created timestamp &lt;= now + maxSkew * 1000;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;created timestamp &gt;= now - ttl* 1000;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6356681122544789610?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6356681122544789610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacherampartrampartexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6356681122544789610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6356681122544789610'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacherampartrampartexception.html' title='org.apache.rampart.RampartException: The timestamp could not be validated'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-5717057485606111431</id><published>2009-08-18T08:15:00.000-07:00</published><updated>2009-08-23T07:44:40.312-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to create wildcard certificates with java keytool?</title><content type='html'>Wildcard SSL Certificates let you secure an unlimited number of sub-domains under a single domain name.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.facilelogin.com/2008/11/wildcard-certificates-with-java-key.html"&gt;This&lt;/a&gt; explains how to do it with java keytool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-5717057485606111431?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/5717057485606111431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-create-wildcard-certificates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5717057485606111431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5717057485606111431'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-create-wildcard-certificates.html' title='How to create wildcard certificates with java keytool?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-5853765488326097570</id><published>2009-08-18T08:13:00.000-07:00</published><updated>2009-08-23T07:45:22.394-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to enable SSL on WAMP?</title><content type='html'>&lt;a href="http://blog.facilelogin.com/2008/07/enabling-ssl-on-wamp.html"&gt;This&lt;/a&gt; step by step guide explains how you can enble SSL on WAMP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-5853765488326097570?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/5853765488326097570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ssl-on-wamp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5853765488326097570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/5853765488326097570'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ssl-on-wamp.html' title='How to enable SSL on WAMP?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8326763731467978222</id><published>2009-08-18T08:10:00.001-07:00</published><updated>2009-08-23T07:45:44.470-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to dump out JKS private key?</title><content type='html'>&lt;a href="http://blog.facilelogin.com/2008/11/dumping-out-jks-private-key.html"&gt;This&lt;/a&gt; post explains how you could programmatically access a java key store and dump its private key out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8326763731467978222?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8326763731467978222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-dump-out-jks-private-key.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8326763731467978222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8326763731467978222'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-dump-out-jks-private-key.html' title='How to dump out JKS private key?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-3677345173643319628</id><published>2009-08-18T08:03:00.000-07:00</published><updated>2009-08-23T07:46:23.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to ceate a new JKS with an existing private key and a signed certificate?</title><content type='html'>You have your own private key and a CA signed certificate - and now you want to import both the key and the certificate to a new JKS.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://blog.facilelogin.com/2008/08/creating-new-jks-with-existing-private.html"&gt;this&lt;/a&gt; blog post I explain how to do it from scratch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-3677345173643319628?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/3677345173643319628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-ceate-new-jks-with-existing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3677345173643319628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/3677345173643319628'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-ceate-new-jks-with-existing.html' title='How to ceate a new JKS with an existing private key and a signed certificate?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7038716037643319159</id><published>2009-08-18T08:00:00.000-07:00</published><updated>2009-08-23T07:46:42.948-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to create a Certificate Authority with OpenSSL on Windows?</title><content type='html'>&lt;a href="http://blog.facilelogin.com/2008/10/openssl-under-windows.html"&gt;This&lt;/a&gt; post explains all the steps you need to create your own CA with OpenSSL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7038716037643319159?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7038716037643319159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-create-certificate-authority.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7038716037643319159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7038716037643319159'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-create-certificate-authority.html' title='How to create a Certificate Authority with OpenSSL on Windows?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-9221742248810227539</id><published>2009-08-18T07:54:00.000-07:00</published><updated>2009-08-23T07:47:02.586-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to secure web services with HTTP Basic Authentication?</title><content type='html'>&lt;a href="http://blog.facilelogin.com/2008/11/secure-your-service-with-http-basic.html"&gt;This&lt;/a&gt; post explains how you could secure your web service with HTTP Basic Authentication.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-9221742248810227539?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/9221742248810227539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-services-with-http.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/9221742248810227539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/9221742248810227539'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-services-with-http.html' title='How to secure web services with HTTP Basic Authentication?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6680845786104388297</id><published>2009-08-18T07:51:00.000-07:00</published><updated>2009-08-23T07:47:22.268-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to enable SSL on Tomcat?</title><content type='html'>&lt;a href="http://blog.facilelogin.com/2008/11/securing-tomcat.html"&gt;This&lt;/a&gt; post explains how you can enable SSL on Tomcat.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6680845786104388297?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6680845786104388297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ssl-on-tomcat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6680845786104388297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6680845786104388297'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-enable-ssl-on-tomcat.html' title='How to enable SSL on Tomcat?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-9044017366056623580</id><published>2009-08-18T07:41:00.000-07:00</published><updated>2009-08-23T07:47:42.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to setup a secure conversation with an STS?</title><content type='html'>In &lt;a href="http://blog.facilelogin.com/2008/10/secure-conversation-with-sts.html"&gt;this &lt;/a&gt;blog post, I explain steps required in setting up a Secure Conversation between a client and a service with the aid of an STS[Secure Token Service].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-9044017366056623580?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/9044017366056623580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-setup-secure-conversation-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/9044017366056623580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/9044017366056623580'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-setup-secure-conversation-with.html' title='How to setup a secure conversation with an STS?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8671887873122501819</id><published>2009-08-18T07:37:00.000-07:00</published><updated>2009-08-23T07:48:00.433-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to do UsernameToken authentication for web services based on AD?</title><content type='html'>in &lt;a href="http://blog.facilelogin.com/2008/11/usernametoken-authentication-based-on.html"&gt;this&lt;/a&gt; post, I explain how you can authenticate users at the service end against an Active Directory[AD] - in the CallbackHandler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8671887873122501819?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8671887873122501819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-do-usernametoken-authentication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8671887873122501819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8671887873122501819'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-do-usernametoken-authentication.html' title='How to do UsernameToken authentication for web services based on AD?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2900915803980843759</id><published>2009-08-18T07:32:00.000-07:00</published><updated>2009-08-23T07:48:17.420-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>How to secure a web service with UsernameToken?</title><content type='html'>In &lt;a href="http://blog.facilelogin.com/2008/11/security-policy-with-rampart.html"&gt;this&lt;/a&gt; bolg post, I explain security policy basics with an example in Rampart.&lt;br /&gt;&lt;br /&gt;There the service expects clients to authenticate themselves with username/password credentials.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2900915803980843759?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2900915803980843759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-service-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2900915803980843759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2900915803980843759'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-secure-web-service-with.html' title='How to secure a web service with UsernameToken?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-4175068421342156147</id><published>2009-08-18T07:12:00.000-07:00</published><updated>2009-08-23T07:48:37.933-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>Can we have multiple private keys in a single JKS?</title><content type='html'>Yes - we can have any number of private/public key pairs in a given keystore.&lt;br /&gt;&lt;br /&gt;We can use &lt;strong&gt;KeyTool IUI&lt;/strong&gt; to get this done - which is available &lt;a href="http://www.softpedia.com/get/Security/Security-Related/KeyTool-IUI.shtml"&gt;here &lt;/a&gt;for free download.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-4175068421342156147?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/4175068421342156147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-have-multiple-provate-keys-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4175068421342156147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/4175068421342156147'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/can-we-have-multiple-provate-keys-in.html' title='Can we have multiple private keys in a single JKS?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8673798795457964380</id><published>2009-08-18T07:06:00.000-07:00</published><updated>2009-08-23T07:49:02.935-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>How to import/export certificates using Java keytool?</title><content type='html'>&lt;strong&gt;\&gt;keytool -import -alias localhost -keystore wso2carbon.jks -file mycert.cer&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The above will import the certificate mycert.cer to the keystore wso2carbon.jks - and will be stored with the alias localhost&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;\&gt;keytool -export -alias localhost -keystore wso2carbon.jks -file mycert.cer&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The above will export the certificate having the alias 'localhost' from the keystore wso2carbon.jks - to mycert.cer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8673798795457964380?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8673798795457964380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-importexport-certificates-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8673798795457964380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8673798795457964380'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-importexport-certificates-using.html' title='How to import/export certificates using Java keytool?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-801549454012150456</id><published>2009-08-18T04:44:00.000-07:00</published><updated>2009-08-23T07:49:21.177-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Advance'/><title type='text'>How to call web services having SSL mutual authentication enabled?</title><content type='html'>First - your client needs to trust the service's certificate.&lt;br /&gt;&lt;br /&gt;So - import the CA cert who signed service's certificate, to your trust store at the client side.&lt;br /&gt;&lt;br /&gt;Then you need to set following in your client code;&lt;br /&gt;&lt;br /&gt;System.setProperty("javax.net.ssl.trustStore", "truststore.jks");&lt;br /&gt;System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");&lt;br /&gt;System.setProperty("javax.net.ssl.keyStore", "keystore.jks");&lt;br /&gt;System.setProperty("javax.net.ssl.keyStorePassword", "wso2carbon");&lt;br /&gt;&lt;br /&gt;keystore.jks will have your public certificate.&lt;br /&gt;&lt;br /&gt;Or else, you can pass these parameters in command line as well;&lt;br /&gt;&lt;br /&gt;\&gt; client -Djavax.net.ssl.trustStore=truststore.jks &lt;br /&gt;-Djavax.net.ssl.trustStorePassword=wso2carbon &lt;br /&gt;-Djavax.net.ssl.trustStoreType=JKS &lt;br /&gt;-Djavax.net.ssl.keyStore=keystore.jks &lt;br /&gt;-Djavax.net.ssl.keyStorePassword=wso2carbon&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-801549454012150456?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/801549454012150456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-call-web-service-having-ssl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/801549454012150456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/801549454012150456'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/how-to-call-web-service-having-ssl.html' title='How to call web services having SSL mutual authentication enabled?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-2728738090035876566</id><published>2009-08-18T03:55:00.000-07:00</published><updated>2009-08-18T07:22:33.785-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>&lt;ramp:user&gt; vs &lt;ramp:encryptionUser&gt; vs &lt;ramp:userCertAlias&gt;</title><content type='html'>&lt;strong&gt;&lt;em&gt;&amp;lt;ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"&gt;&lt;br /&gt;&amp;lt;ramp:user&gt;service&amp;lt;/ramp:user&gt;&lt;br /&gt;&amp;lt;ramp:encryptionUser&gt;client&amp;lt;/ramp:encryptionUser&gt;&lt;br /&gt;&amp;lt;ramp:userCertAlias&gt;client&amp;lt;/ramp:userCertAlias&gt;&lt;br /&gt;&amp;lt;/ramp:RampartConfig&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&amp;lt;ramp:user&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;This is the user name used to retrieve the password from the &lt;strong&gt;CallbackHandler&lt;/strong&gt; when UsernameToken security policy being configured.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&amp;lt;ramp:userCertAlias&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;This is the key alias used to retrive the password of the corresponding private key from the CallbackHandler.&lt;br /&gt;&lt;br /&gt;In the absence of this, &amp;lt;ramp:user&gt; is used for the same purpose.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;&amp;lt;ramp:encryptionUser&gt;&lt;/u&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is the key alias of the public key used to encrypt the message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-2728738090035876566?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/2728738090035876566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/vs-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2728738090035876566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/2728738090035876566'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/vs-vs.html' title='&amp;lt;ramp:user&gt; vs &amp;lt;ramp:encryptionUser&gt; vs &amp;lt;ramp:userCertAlias&gt;'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6383263549431465534</id><published>2009-08-18T02:49:00.000-07:00</published><updated>2009-08-25T12:45:49.920-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>java.security.UnrecoverableKeyException: Cannot recover key</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;Caused by: java.security.UnrecoverableKeyException: Cannot recover key&lt;br /&gt;at sun.security.provider.KeyProtector.recover(Unknown Source)&lt;br /&gt;at sun.security.provider.JavaKeyStore.engineGetKey(Unknown Source)&lt;br /&gt;at sun.security.provider.JavaKeyStore$JKS.engineGetKey(Unknown Source)&lt;br /&gt;at java.security.KeyStore.getKey(Unknown Source)&lt;br /&gt;at org.apache.ws.security.components.crypto.CryptoBase.getPrivateKey(CryptoBase.java:216)&lt;br /&gt;at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:713)... 14 more&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;Incorrect password provided from the CallbackHandler for the private key.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Correctthe password provided from the CallbackHandler for the private key.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6383263549431465534?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6383263549431465534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/javasecurityunrecoverablekeyexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6383263549431465534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6383263549431465534'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/javasecurityunrecoverablekeyexception.html' title='java.security.UnrecoverableKeyException: Cannot recover key'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-7672587790596736551</id><published>2009-08-18T01:45:00.000-07:00</published><updated>2009-08-25T12:47:03.187-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html &lt;br /&gt;at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) &lt;br /&gt;at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90) &lt;br /&gt;at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353) &lt;br /&gt;at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) &lt;br /&gt;at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) &lt;br /&gt;at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) &lt;br /&gt;at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;Service epr is incorrect. Basically the call is returning a HTML page instead of a SOAP document.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Correct the service epr.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-7672587790596736551?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/7672587790596736551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacheaxis2axisfault-first-element.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7672587790596736551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/7672587790596736551'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacheaxis2axisfault-first-element.html' title='org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6478573151739889420</id><published>2009-08-18T00:54:00.000-07:00</published><updated>2009-08-25T12:48:00.812-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Security' while deploying handler 'PolicyBasedSecurityOutHandler'</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Security' while deploying handler 'PolicyBasedSecurityOutHandler'. &lt;br /&gt;at org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:75) &lt;br /&gt;at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToFlow(PhaseResolver.java:68)&lt;br /&gt;at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:104) at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:110)&lt;br /&gt;at org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:158) &lt;br /&gt;at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:490) at org.apache.axis2.description.AxisService.onEngage(AxisService.java:788) &lt;br /&gt;at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:490) at org.apache.axis2.description.AxisServiceGroup.onEngage(AxisServiceGroup.java:134)&lt;br /&gt;at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:490) at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:453)&lt;br /&gt;at org.apache.axis2.engine.AxisConfiguration.addServiceGroup(AxisConfiguration.java:323) at org.apache.axis2.engine.AxisConfiguration.addService(AxisConfiguration.java:293) &lt;br /&gt;at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:175) &lt;br /&gt;at org.apache.axis2.client.ServiceClient.&lt;init&gt;(ServiceClient.java:143)&lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;"Security" phase is not defined under "OutFaultFlow" in axi2.xml - which is required [by default this should be there]&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;Define "Security" phase under "OutFaultFlow" in axi2.xml&lt;br /&gt;&lt;br /&gt;&amp;lt;phaseOrder type="OutFaultFlow"&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="soapmonitorPhase"/&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="OperationOutFaultPhase"/&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="RMPhase"/&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="PolicyDetermination"/&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="MessageOut"/&gt;&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;phase name="Security"/&gt;&lt;br /&gt;&amp;lt;/phaseOrder&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6478573151739889420?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6478573151739889420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacheaxis2phaseresolverphaseexcepti.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6478573151739889420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6478573151739889420'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/orgapacheaxis2phaseresolverphaseexcepti.html' title='org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase &apos;Security&apos; while deploying handler &apos;PolicyBasedSecurityOutHandler&apos;'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-6185677944226773670</id><published>2009-08-18T00:19:00.000-07:00</published><updated>2009-08-25T12:49:21.101-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Intermediate'/><title type='text'>java.security.InvalidKeyException: Illegal key size or default parameters</title><content type='html'>&lt;strong&gt;Exception :&lt;/strong&gt;&lt;pre name="code" class="html"&gt;Caused by: org.apache.ws.security.WSSecurityException: Cannot encrypt data; nested exception is:&lt;br /&gt;org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters&lt;br /&gt;Original Exception was java.security.InvalidKeyException: Illegal key size or default parameters&lt;br /&gt;at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:567)&lt;br /&gt;at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:454)&lt;br /&gt;at org.apache.ws.security.message.WSSecEncrypt.encryptForInternalRef(WSSecEncrypt.java:351)&lt;br /&gt;at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:530)&lt;br /&gt;... 12 more &lt;/pre&gt;&lt;strong&gt;Root Cause :&lt;/strong&gt;&lt;br /&gt;There are key size restrictions with the default JDK comes with - which limits it to 128.&lt;br /&gt;&lt;br /&gt;If your security policy uses a key size larger than this - then the above exception is thrown.&lt;br /&gt;&lt;br /&gt;For example - if your security policy specifies the algorithemic suite as Basic256 - then the key size to be used is 256.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;br /&gt;You need to patch your JDK with Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.&lt;br /&gt;&lt;br /&gt;For JDK 1.5 download those from &lt;a href="http://java.sun.com/javase/downloads/index_jdk5.jsp"&gt;here&lt;/a&gt; and copy the two jar files from the extracted jce directory (local_policy.jar and US_export_policy.jar) to $JAVA_HOME/jre/lib/security.&lt;br /&gt;&lt;br /&gt;For JDK 1.6, policy files can be downloaded from &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Notes :&lt;/strong&gt;&lt;br /&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-6185677944226773670?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/6185677944226773670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/faq-001-javasecurityinvalidkeyexception.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6185677944226773670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/6185677944226773670'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/faq-001-javasecurityinvalidkeyexception.html' title='java.security.InvalidKeyException: Illegal key size or default parameters'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1957034268544385663.post-8313208128571395248</id><published>2009-08-17T11:51:00.000-07:00</published><updated>2009-08-25T11:54:30.960-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Basic'/><title type='text'>What is Rampart?</title><content type='html'>&lt;a href="http://www.ruchith.org/"&gt;Ruchith&lt;/a&gt; explains &lt;a href="https://www.wso2.org/library/695"&gt;here&lt;/a&gt; the story behind Rampart/Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1957034268544385663-8313208128571395248?l=blog.rampartfaq.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rampartfaq.com/feeds/8313208128571395248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-is-rampart.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8313208128571395248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1957034268544385663/posts/default/8313208128571395248'/><link rel='alternate' type='text/html' href='http://blog.rampartfaq.com/2009/08/what-is-rampart.html' title='What is Rampart?'/><author><name>Prabath Siriwardena</name><uri>http://www.blogger.com/profile/03738272954977004335</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
