<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Softwaremaker - WS-Splat Specs</title>
    <link>http://www.softwaremaker.net/blog/</link>
    <description>&lt;Challenging Conventions /&gt;</description>
    <language>en-us</language>
    <copyright>William T</copyright>
    <lastBuildDate>Fri, 24 Oct 2008 00:58:46 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>itnews@softwaremaker.net</managingEditor>
    <webMaster>itnews@softwaremaker.net</webMaster>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=ed446f21-e2ca-46a7-8dad-5ab67a0fdf85</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,ed446f21-e2ca-46a7-8dad-5ab67a0fdf85.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ahhh ... it has been a while, hasnt it ?
</p>
        <p>
My life is just torn between working with bits of 2, beats of 4 and nucleotides of
4. But while challenging, it has been really <a href="http://sg.vr-zone.com/articles/acryan-playon-hdmi-network-digital-video-recorder-review-updated-13-oct-/6084.html" target="_blank">fun</a>.
As spoken to a friend today, my passions in life seeks out to expand the comfort boundaries
of gray matter, which we called the mind and to constantly challenge and stimulate
the brain to learn and absorb new things that one would never think of learning if
one boxed themself in a virtual space, which techies like me would call "typecast".
</p>
        <p>
One example that I highlighted to my friend today, which I respectfully pointed out
to them that he falls under, is when he said: "<em>But we tech people are not good
at talking to people and engaging them in meaningful conversations ...</em>"
</p>
        <p>
Typecast alert !
</p>
        <p>
I ended up talking with him (not to him) for a good 20 minutes and told him we just
had a meaningful conversation and that he could hold one really well. I told him that
he himself set up this virtual boundary to box himself in. No one did and that he
could easily remove this barrier and elevate himself to do and more importantly, to
learn new things and behaviors. Instead of having new curiousities about old things,
have new questions, passions and interests towards <em><strong>new</strong></em> things.
</p>
        <p>
Anyways, I wont be talking about my new-found passions here but I will be briefly
touching on a topic that many people knew I have passions for (and I still do) - and
that is the innards and the plumbings of software technologies.
</p>
        <p>
I came across types of this type of questions a lot in emails, forum questions and
usergroup events:
</p>
        <p>
          <img height="34" alt="openquotes.png" src="http://www.softwaremaker.net/blog/content/binary/openquotes.png" width="44" border="0" /> I
have this WSDL file that looks something like this:
</p>
        <p>
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
</p>
        <p>
&lt;definitions name="someCustomer" targetNamespace="urn:someCustomer" xmlns:typens="urn:someCustomer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"&gt;<br />
      &lt;message name="add_someCustomer"&gt;<br />
            &lt;part name="resId"
type="xsd:string"/&gt;<br />
            &lt;part name="cPortable"
type="xsd:string"/&gt;<br />
      &lt;/message&gt;<br />
      &lt;message name="add_someCustomerResponse"&gt;<br />
            &lt;part name="add_someCustomerReturn"
type="xsd:string"/&gt;<br />
      &lt;/message&gt;<br />
      &lt;portType name="someCustomerPortType"&gt;<br />
            &lt;operation name="add_someCustomer"&gt;<br />
                 
&lt;input message="typens:add_someCustomer"/&gt;<br />
                 
&lt;output message="typens:add_someCustomerResponse"/&gt;<br />
            &lt;/operation&gt;<br />
      &lt;/portType&gt;<br />
      &lt;binding name="someCustomerBinding" type="typens:someCustomerPortType"&gt;<br />
            &lt;soap:binding
style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;<br />
            &lt;operation name="add_someCustomer"&gt;<br />
                 
&lt;soap:operation soapAction="urn:someCustomerAction"/&gt;<br />
                 
&lt;input&gt;<br />
                       
&lt;soap:body namespace="urn:someCustomer" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;<br />
                 
&lt;/input&gt;<br />
                 
&lt;output&gt;<br />
                       
&lt;soap:body namespace="urn:someCustomer" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;<br />
                 
&lt;/output&gt;<br />
            &lt;/operation&gt;<br />
      &lt;/binding&gt;<br />
      &lt;service name="someCustomerService"&gt;<br />
            &lt;port name="someCustomerPort"
binding="typens:someCustomerBinding"&gt;<br />
                 
&lt;soap:address location="http://foo/bar/someCustomer.php"/&gt;<br />
            &lt;/port&gt;<br />
      &lt;/service&gt;<br />
&lt;/definitions&gt;<br /></p>
        <p>
However, I need to change the add_someCustomerReturn  type from xsd:string to
a complex type.
</p>
        <p>
I’ve made several tests variants around trying to add a complex type, like the following:
</p>
        <p>
      &lt;message name="add_someCustomerResponse"&gt;<br />
            &lt;xsd:complexType
name="respType" &gt;<br />
                 
&lt;xsd:sequence&gt;<br />
                       
&lt;xsd:element name="someStatus" type="xsd:boolean" /&gt;<br />
                       
&lt;xsd:element name="someResult" type="xsd:boolean" /&gt;<br />
                 
&lt;/xsd:sequence&gt;<br />
            &lt;/xsd:complexType&gt;<br />
            &lt;part name="add_someCustomerReturn"
type="typens:respType"/&gt;<br />
      &lt;/message&gt;
</p>
        <p>
However I always end up having an error like:
</p>
        <p>
Custom tool error: Unable to import WebService/Schema. Unable to import binding 'customerBinding'
from namespace 'urn:customer'. Unable to import operation 'add_customer'. The datatype
'urn:customer:respType' is missing. <img height="34" alt="closequotes.png" src="http://www.softwaremaker.net/blog/content/binary/closequotes.png" width="44" border="0" /></p>
        <p>
          <br />
One thing to note is the above "web service" is using: <strong><em><u>soap:binding
style="rpc"</u></em></strong>. While I am not advocating one over another (<strong><em><u>document/literal</u></em></strong>),
I personally think that if you stripped the religious and philisophical debates, one
can certainly build a RPC-style web service using doc/literal encoding.
</p>
        <p>
The above exceptions funs afoul of what many techies called: <a href="http://www.w3.org/TR/wsdl" target="_blank">Section
5 Encoding</a></p>
        <p>
For the above to be resolved, you need to define a complexType reference by wsdl:part
“add_someCustomerReturn” <strong><em>in the schema</em></strong>.<br />
To do this, you MUST define wsdl:types and add the schema to the WSDL that defines
the complex and change the type=”xsd:string” (of the wsdl:part) to the identifying
complexType in the schema (encoded in wsdl:types)<br /></p>
        <p>
While this is an old article written by Tim, the same principles apply. Do check it
out of you need to stimulate your brain: <a href="http://msdn.microsoft.com/en-us/library/ms995710.aspx" target="_blank">The
Argument against SOAP Encoding</a></p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ed446f21-e2ca-46a7-8dad-5ab67a0fdf85" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>All about WSDL, Types and Section 5 Encoding (again)</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,ed446f21-e2ca-46a7-8dad-5ab67a0fdf85.aspx</guid>
      <link>http://www.softwaremaker.net/blog/AllAboutWSDLTypesAndSection5EncodingAgain.aspx</link>
      <pubDate>Fri, 24 Oct 2008 00:58:46 GMT</pubDate>
      <description>&lt;p&gt;
Ahhh ... it has been a while, hasnt it ?
&lt;/p&gt;
&lt;p&gt;
My life is just torn between working with bits of 2, beats of 4 and nucleotides of
4. But while challenging, it has been really &lt;a href="http://sg.vr-zone.com/articles/acryan-playon-hdmi-network-digital-video-recorder-review-updated-13-oct-/6084.html" target=_blank&gt;fun&lt;/a&gt;.
As spoken to a friend today, my passions in life seeks out to expand the comfort boundaries
of gray matter, which we called the mind and to constantly challenge and stimulate
the brain to learn and absorb new things that one would never think of learning if
one boxed themself in a virtual space, which techies like me&amp;nbsp;would call "typecast".
&lt;/p&gt;
&lt;p&gt;
One example that I highlighted to my friend today, which I respectfully pointed out
to them that he falls under, is when he said: "&lt;em&gt;But we tech people are not good
at talking to people and engaging them in meaningful conversations ...&lt;/em&gt;"
&lt;/p&gt;
&lt;p&gt;
Typecast alert !
&lt;/p&gt;
&lt;p&gt;
I ended up talking with him (not to him) for a good 20 minutes and told him we just
had a meaningful conversation and that he could hold one really well. I told him that
he himself set up this virtual boundary to box himself in. No one did and that he
could easily remove this barrier and elevate himself to do and more importantly, to
learn new things and behaviors. Instead of having new curiousities about old things,
have new questions, passions and interests&amp;nbsp;towards &lt;em&gt;&lt;strong&gt;new&lt;/strong&gt;&lt;/em&gt; things.
&lt;/p&gt;
&lt;p&gt;
Anyways, I wont be talking about my new-found passions here but I will be briefly
touching on a topic that many people knew I have passions for (and I still do) - and
that is the innards and the plumbings of software technologies.
&lt;/p&gt;
&lt;p&gt;
I came across types of this type of questions a lot in emails, forum questions and
usergroup events:
&lt;/p&gt;
&lt;p&gt;
&lt;img height=34 alt=openquotes.png src="http://www.softwaremaker.net/blog/content/binary/openquotes.png" width=44 border=0&gt;&amp;nbsp;I
have this WSDL file that looks something like this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&amp;lt;definitions name="someCustomer" targetNamespace="urn:someCustomer" xmlns:typens="urn:someCustomer"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;message name="add_someCustomer"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part name="resId"
type="xsd:string"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part name="cPortable"
type="xsd:string"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/message&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;message name="add_someCustomerResponse"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part name="add_someCustomerReturn"
type="xsd:string"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/message&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portType name="someCustomerPortType"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;operation name="add_someCustomer"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;input message="typens:add_someCustomer"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;output message="typens:add_someCustomerResponse"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/operation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/portType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="someCustomerBinding" type="typens:someCustomerPortType"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;soap:binding
style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;operation name="add_someCustomer"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;soap:operation soapAction="urn:someCustomerAction"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;input&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;soap:body namespace="urn:someCustomer" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/input&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;output&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;soap:body namespace="urn:someCustomer" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/output&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/operation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service name="someCustomerService"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;port name="someCustomerPort"
binding="typens:someCustomerBinding"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;soap:address location="http://foo/bar/someCustomer.php"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/port&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;lt;/definitions&amp;gt;&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
However, I need to change the add_someCustomerReturn&amp;nbsp; type from xsd:string to
a complex type.
&lt;/p&gt;
&lt;p&gt;
I’ve made several tests variants around trying to add a complex type, like the following:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;message name="add_someCustomerResponse"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:complexType
name="respType" &amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;xsd:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;xsd:element name="someStatus" type="xsd:boolean" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;xsd:element name="someResult" type="xsd:boolean" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/xsd:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsd:complexType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;part name="add_someCustomerReturn"
type="typens:respType"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/message&amp;gt;
&lt;/p&gt;
&lt;p&gt;
However I always end up having an error like:
&lt;/p&gt;
&lt;p&gt;
Custom tool error: Unable to import WebService/Schema. Unable to import binding 'customerBinding'
from namespace 'urn:customer'. Unable to import operation 'add_customer'. The datatype
'urn:customer:respType' is missing. &lt;img height=34 alt=closequotes.png src="http://www.softwaremaker.net/blog/content/binary/closequotes.png" width=44 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
One thing to note is the above "web service" is using: &lt;strong&gt;&lt;em&gt;&lt;u&gt;soap:binding
style="rpc"&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;. While I am not advocating one over another (&lt;strong&gt;&lt;em&gt;&lt;u&gt;document/literal&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;),
I personally think that if you stripped the religious and&amp;nbsp;philisophical debates,&amp;nbsp;one
can certainly build a RPC-style web service using doc/literal encoding.
&lt;/p&gt;
&lt;p&gt;
The above exceptions funs afoul of what many techies called: &lt;a href="http://www.w3.org/TR/wsdl" target=_blank&gt;Section
5 Encoding&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
For the above to be resolved, you need to define a complexType reference by wsdl:part
“add_someCustomerReturn” &lt;strong&gt;&lt;em&gt;in the schema&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
To do this, you MUST define wsdl:types and add the schema to the WSDL that defines
the complex and change the type=”xsd:string” (of the wsdl:part) to the identifying
complexType in the schema (encoded in wsdl:types)&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
While this is an old article written by Tim, the same principles apply. Do check it
out of you need to stimulate your brain: &lt;a href="http://msdn.microsoft.com/en-us/library/ms995710.aspx" target=_blank&gt;The
Argument against SOAP Encoding&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ed446f21-e2ca-46a7-8dad-5ab67a0fdf85" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Interoperability;Software Development;Useful Tips;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=ffb0444f-6f6f-4840-9082-9f3bf0e2a4c6</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,ffb0444f-6f6f-4840-9082-9f3bf0e2a4c6.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Finally, <a href="http://www.oasis-open.org" target="_blank">OASIS</a> announced last
week that it is <a href="http://www.oasis-open.org/archives/members/200704/msg00023.html" target="_blank">calling
for participation for Web Services Federation</a>. The formation of the WS-Federation
Technical Committee is announced <a href="http://www.oasis-open.org/news/oasis-news-2007-05-02.php" target="_blank">here</a>.
</p>
        <p>
WS-Fed is an important addition to the WS-* protocol suite that enables users to sign-in
seamlessly to systems outside of their own organization without requiring (more) new
usernames and passwords using Single-Sign-On (SSO) between separate organizations
with an established trust relationship.
</p>
        <p>
          <em>
            <strong>WS-Fed builds upon and composes with other WS-* protocols:</strong>
          </em>
        </p>
        <ul>
          <li>
WS-Fed extends WS-Trust 
</li>
          <li>
WS-Fed composes with WS-Security and WS-SecureConversation to ensure data integrity
and privacy 
</li>
          <li>
WS-Fed composes with WS-MetadataExchange and WS-Policy to enable simple provisioning
and trust relationship configuration</li>
        </ul>
        <p>
          <strong>
            <em>Does WS-Fed compete with Liberty SAML?<br /></em>
          </strong>
        </p>
        <ul>
          <li>
Both SAML and WS-Fed enable browser-based identity federation (<em>Passive-Mode</em>) 
</li>
          <li>
However, WS-Fed enables a superset of scenarios, including: 
<ul><li>
Seamless federation with Web Services and/or Rick-Client applications 
</li><li>
Separation of identities, token types, protocols and encodings 
</li><li>
Multi-purpose Security Token Service (STS) that can return tokens stating different
assertions based upon the scenario<br /></li></ul></li>
        </ul>
        <p>
          <strong>
            <em>WS-Fed adds identity federation capabilities to the existing WS-* suite
of protocols resulting in:</em>
          </strong>
          <br />
        </p>
        <ul>
          <li>
A single protocol stack that supports the majority of your needs and scenarios 
</li>
          <li>
Simplified development, deployment, management and control</li>
        </ul>
        <p>
The formation of the Technical Committee to drive the standardization of the WS-Fed
is an important step in evolution of the industry-wide effort to create a single,
comprehensive communication protocol suite that enables many current and new scenarios
most effectively.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ffb0444f-6f6f-4840-9082-9f3bf0e2a4c6" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>OASIS and the WS-Federation Specifications</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,ffb0444f-6f6f-4840-9082-9f3bf0e2a4c6.aspx</guid>
      <link>http://www.softwaremaker.net/blog/OASISAndTheWSFederationSpecifications.aspx</link>
      <pubDate>Wed, 02 May 2007 03:39:08 GMT</pubDate>
      <description>&lt;p&gt;
Finally, &lt;a href="http://www.oasis-open.org" target="_blank"&gt;OASIS&lt;/a&gt; announced last
week that it is &lt;a href="http://www.oasis-open.org/archives/members/200704/msg00023.html" target=_blank&gt;calling
for participation for Web Services Federation&lt;/a&gt;. The formation of the WS-Federation
Technical Committee is announced &lt;a href="http://www.oasis-open.org/news/oasis-news-2007-05-02.php" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
WS-Fed is an important addition to the WS-* protocol suite that enables users to sign-in
seamlessly to systems outside of their own organization without requiring (more) new
usernames and passwords using Single-Sign-On (SSO) between separate organizations
with an established trust relationship.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;WS-Fed builds upon and composes with other WS-* protocols:&lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
WS-Fed extends WS-Trust 
&lt;li&gt;
WS-Fed composes with WS-Security and WS-SecureConversation to ensure data integrity
and privacy 
&lt;li&gt;
WS-Fed composes with WS-MetadataExchange and WS-Policy to enable simple provisioning
and trust relationship configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;&lt;em&gt;Does WS-Fed compete with Liberty SAML?&lt;br&gt;
&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Both SAML and WS-Fed enable browser-based identity federation (&lt;em&gt;Passive-Mode&lt;/em&gt;) 
&lt;li&gt;
However, WS-Fed enables a superset of scenarios, including: 
&lt;ul&gt;
&lt;li&gt;
Seamless federation with Web Services and/or Rick-Client applications 
&lt;li&gt;
Separation of identities, token types, protocols and encodings 
&lt;li&gt;
Multi-purpose Security Token Service (STS) that can return tokens stating different
assertions based upon the scenario&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;&lt;em&gt;WS-Fed adds identity federation capabilities to the existing WS-* suite
of protocols resulting in:&lt;/em&gt;&lt;/strong&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
A single protocol stack that supports the majority of your needs and scenarios 
&lt;li&gt;
Simplified development, deployment, management and control&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The formation of the Technical Committee to drive the standardization of the WS-Fed
is an important step in evolution of the industry-wide effort to create a single,
comprehensive communication protocol suite that enables many current and new scenarios
most effectively.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ffb0444f-6f6f-4840-9082-9f3bf0e2a4c6" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Interoperability;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=49bc4e2e-361d-4d27-9cab-41f8ca443175</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,49bc4e2e-361d-4d27-9cab-41f8ca443175.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This popped into my inbox a while ago ... 
</p>
        <p>
          <img height="139" alt="image_emailing_securetheweb_072006.jpg" src="http://www.softwaremaker.net/blog/content/binary/image_emailing_securetheweb_072006.jpg" width="227" border="0" />
        </p>
        <p>
Contests like <a href="http://www.securetheweb.axalto.com/securetheweb2006.asp" target="_blank">this</a> are
just great. Not only are you receiving money (if you win... Who cares, even if you
dont, a digital mutation of your idea may still evolve to a sellable one), you are
competing with the best to generate a innovative, marketable, secured and (hopefully)
usable product. The byproduct derived from the entire process would be similar to
a mini-version of an RFC. Bad and unsecured ones would have been shot down and the
good ones could be made better with a few ingenious tweaks.
</p>
        <p>
Now only if I can find 25.5 hours in any given day ...
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=49bc4e2e-361d-4d27-9cab-41f8ca443175" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Creative Innovation at Security Integration</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,49bc4e2e-361d-4d27-9cab-41f8ca443175.aspx</guid>
      <link>http://www.softwaremaker.net/blog/CreativeInnovationAtSecurityIntegration.aspx</link>
      <pubDate>Fri, 07 Jul 2006 06:45:38 GMT</pubDate>
      <description>&lt;p&gt;
This popped into my inbox a while ago ... 
&lt;/p&gt;
&lt;p&gt;
&lt;img height=139 alt=image_emailing_securetheweb_072006.jpg src="http://www.softwaremaker.net/blog/content/binary/image_emailing_securetheweb_072006.jpg" width=227 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Contests like &lt;a href="http://www.securetheweb.axalto.com/securetheweb2006.asp" target=_blank&gt;this&lt;/a&gt; are
just great. Not only are you receiving money (if you win... Who cares, even if you
dont, a digital mutation of your idea may still evolve to a sellable one), you are
competing with the best to generate a innovative, marketable, secured and (hopefully)
usable product. The byproduct derived from the entire process would be similar to
a mini-version of an RFC. Bad and unsecured ones would have been shot down and the
good ones could be made better with a few ingenious tweaks.
&lt;/p&gt;
&lt;p&gt;
Now only if I can find 25.5 hours in any given day ...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=49bc4e2e-361d-4d27-9cab-41f8ca443175" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Community;Software Development;Technology;WS-Splat Specs</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=899fe212-5778-451a-b2cc-0b27f39349c2</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,899fe212-5778-451a-b2cc-0b27f39349c2.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <title>Published: WCF Interoperability with WSE 2.0 and the Migration Incentive</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,899fe212-5778-451a-b2cc-0b27f39349c2.aspx</guid>
      <link>http://www.softwaremaker.net/blog/PublishedWCFInteroperabilityWithWSE20AndTheMigrationIncentive.aspx</link>
      <pubDate>Fri, 07 Jul 2006 06:11:57 GMT</pubDate>
      <description>&lt;p&gt;
Blasphemy ...
&lt;/p&gt;
&lt;p&gt;
It is finally &lt;a href="http://wcf.netfx3.com/content/WindowsCommunicationFoundationWCFInteroperabilityandMigrationwithWSE20.aspx" target="_blank"&gt;published&lt;/a&gt;.
After many, many, and I mean, many months of paying the process tax for this piece,
it is finally &lt;a href="http://wcf.netfx3.com/content/WindowsCommunicationFoundationWCFInteroperabilityandMigrationwithWSE20.aspx" target="_blank"&gt;LIVE&lt;/a&gt; !
&lt;/p&gt;
&lt;p&gt;
I started this piece with the first ever March 2005 CTP of &lt;a href=http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx target=_blank&gt;Windows
Communication Foundation (WCF, previously - Indigo)&lt;/a&gt; and I went through so many
port demos and edit document cycles its so unbelievably painful ...
&lt;/p&gt;
&lt;p&gt;
But it is really good to see this in online form and shape.
&lt;/p&gt;
&lt;p&gt;
I started with this idea even though &lt;a href=http://www.microsoft.com target=_blank&gt;MSFT
Corp&lt;/a&gt; has &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/WSS_Appx_InteropCons_WSE30.asp" target="_blank"&gt;explicity
stated that it will not support any form of interoperability&lt;/a&gt; between &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1ba1f631-c3e7-420a-bc1e-ef18bab66122&amp;amp;displaylang=en" target="_blank"&gt;WSE
2.0&lt;/a&gt; and WCF, even though it is &amp;quot;&lt;em&gt;theoretically possible to develop Web
services using WSE 2.0 in such a way that they can interoperate with WSE 3.0 (and
WCF) by using only a &lt;strong&gt;reduced set of specifications&lt;/strong&gt;&lt;/em&gt;&amp;quot;
&lt;/p&gt;
&lt;p&gt;
More importantly, the main reason for the motivation to write such a piece&amp;nbsp;is
written in the article itself and I quote:
&lt;/p&gt;
&lt;p&gt;
[BEGIN QUOTE] 
&lt;/p&gt;
&lt;hr /&gt;
&lt;em&gt;&lt;font color="#808080"&gt;...WSE 2.0 has seen 3 service pack releases since its official
launch in 2004. It implemented the OASIS Web Services Security 1.0 specification which
was the widely accepted interoperability standard protocols between secured web services
as well as the implementations of WS-Addressing, WS-SecureConversation and WS-Trust.
It was integrated very nicely into Visual Studio 2003. Even BizTalk Server 2004 carries
with it a WSE 2.0 adapter for securing of Web Services. Thus, it would be fair to
assume that there is more than its fair share of implementations in the market today.&lt;/font&gt;&lt;/em&gt; 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color="#808080"&gt;Depending on timing, budget, complexity and a whole host
of other requirements, some of these applications will need to be moved and migrated
to WSE3.0 and some to WCF. Aaron Skonnard has provided a great &lt;/font&gt;&lt;/em&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/06/04/ServiceStation/" target="_blank"&gt;&lt;em&gt;&lt;font color="#808080"&gt;resource&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font color="#808080"&gt; in
his &amp;ldquo;Service Station&amp;rdquo; column on MSDN on a brief overview on the migration
of WSE 2.0 applications to WSE 3.0 ones. However, as stated in his article, there
are some major changes in the programming model and architecture in WSE 3.0 and migrating
them from WSE 2.0 may not be trivial.&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color="#808080"&gt;Another very important factor to take note is while WinFX,
and therefore WCF, is available downstream from Windows Vista to Windows 2003 and
Windows XP. That is as far down as it goes. There still exists a huge installed base
of Windows 2000 Servers out there running on server and data farms and if you need
to implement the advanced Web Services stacks on those servers, WSE is still a very
important strategy you cannot ignore.&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color="#808080"&gt;As noted in the above guidelines, even though Microsoft
will not guarantee interoperability between WSE 2.0 and WCF, the good news is that
there are a few WSE 2.0 common scenarios, which can allow wire-interoperability with
WCF. I will illustrate them in the next section...&lt;/font&gt;&lt;/em&gt; 
&lt;/p&gt;
&lt;hr /&gt;
[END QUOTE] 
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
So, &lt;a href="http://wcf.netfx3.com/content/WindowsCommunicationFoundationWCFInteroperabilityandMigrationwithWSE20.aspx" target="_blank"&gt;this
article&lt;/a&gt; will outlined &lt;strong&gt;WHAT&lt;/strong&gt; that reduced set of specifications
are and &lt;strong&gt;HOW&lt;/strong&gt; to go about using them.
&lt;/p&gt;
&lt;p&gt;
Many Special Thanks go to &lt;a href="http://pluralsight.com/blogs/kirillg/" target="_blank"&gt;Kirill&lt;/a&gt;,&amp;nbsp;the
Interop PM on WCF, who&amp;nbsp;gave me&amp;nbsp;a couple of&amp;nbsp;tips to get over the&amp;nbsp;port-over
humps I had thoughout this piece since last year. And of course, I cannot forget &lt;a href="http://friends.newtelligence.net/clemensv/" target="_blank"&gt;Clemens&lt;/a&gt;,
who is the catalyst to making this publication happen when he came onboard.
&lt;/p&gt;
&lt;p&gt;
I hope this helps at least someone out there. Enjoy !
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=899fe212-5778-451a-b2cc-0b27f39349c2" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Articles;Community;Interoperability;Software Development;Web Services Enhancements (WSE);Windows Communication Foundation (WCF) aka Indigo;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=af9c64c8-73cf-4ba2-a1b1-536a4c871dae</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,af9c64c8-73cf-4ba2-a1b1-536a4c871dae.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
During my <a href="http://www.softwaremaker.net/blog/MSDNRedmondWebcastingFromSingapore.aspx" target="_blank">webcast</a> on
"Why we need Reliablility in SOAP: Web Services", there were a couple of
hiccups which hindered a better listening experience.
</p>
        <ol>
          <li>
I cannot see the animation on the slides I am presenting, even though I am assured
by the producer that the floor is seeing it. Therefore, I am "guessing"
what the audience is actually seeing in my click-animation and gauging my content
from there. It was neither easy nor pleasant. 
</li>
          <li>
There was a disconnect incident in my demos that also marred the listener's experience.
I had to re-login again. Not Good.</li>
        </ol>
        <p>
Isnt it ironic? My network connection showed lack of reliability when I am talking
about Reliability as a topic. <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" />. Now
the least I can do is to answer a couple of questions that popped up after the session:
</p>
        <p>
Q: Is RM available for all the bindings in <a href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">Windows
Communication Foundation (WCF, previously - Indigo)</a> ? <br />
A: <strong>Yes, it is available for MOST of the standard bindings in WCF. In some
bindings such as the netTcpBinding I showed, it is On-by-Default. In bindings such
as wsDualHttpBinding where you need correlation of different channels and such, it
is Always-On. It doesnt make sense to stick &lt;reliableSession /&gt; in a netMsmqBinding,
for example.</strong></p>
        <p>
Q: Is this the same WS-RM spec that is authored by IBM, Microsoft
and TIBCO ? <br />
A: <strong>Yes. In my slide, I mentioned - I.B.M and <a href="http://www.tibco.com/" target="_blank">TIBCO</a>.
I.B.M is actually the acronym I used for <a href="http://www.ibm.com/" target="_blank">IBM</a>, <a href="http://www.bea.com/" target="_blank">BEA</a> and <a href="http://www.microsoft.com/" target="_blank">Microsoft</a>. <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" /></strong></p>
        <p>
Q: Can I get the demo you showed? <br />
A: <strong>No, I am sorry. In any case, my demos will not work with the lastest
WinFX B2 bits today. I will need time to port them over. I recommend you go bug <a href="http://blogs.msdn.com/shycohen" target="_blank">Shy</a> when
you see him and ask him for his WS-RM demo which consists of a WPF stack in there
and a "awesomely" cool Rubik's Cube demo and is 100x better than mine.</strong></p>
        <p>
All in all, it is quite a different experience than doing an on-stage presentation,
especially when you spent an hour talking to yourself and you cannot see the audience
faces and cannot manipulate your content and presentation based on their moods.
</p>
        <p>
But then again, no one can see that I am wearing my <a href="http://www.treasurekingdom.com/miva/graphics/00000001/boxerlarge3.jpg" target="_blank">Mickey-Mouse
boxers</a> while I am presenting, so I guess that is a good trade-off.
</p>
        <img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=45671be1-e92e-44f8-9862-f72f472f67ee" alt="" width="0" height="0" />
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=af9c64c8-73cf-4ba2-a1b1-536a4c871dae" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Webcast Experience: WS-ReliableMessaging in WCF</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,af9c64c8-73cf-4ba2-a1b1-536a4c871dae.aspx</guid>
      <link>http://www.softwaremaker.net/blog/WebcastExperienceWSReliableMessagingInWCF.aspx</link>
      <pubDate>Wed, 07 Jun 2006 06:06:48 GMT</pubDate>
      <description>&lt;p&gt;
During my &lt;a href="http://www.softwaremaker.net/blog/MSDNRedmondWebcastingFromSingapore.aspx" target="_blank"&gt;webcast&lt;/a&gt; on
&amp;quot;Why we need Reliablility in SOAP: Web Services&amp;quot;, there were a couple of
hiccups which hindered a better listening experience.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
I cannot see the animation on the slides I am presenting, even though I am assured
by the producer that&amp;nbsp;the floor is seeing it. Therefore, I am &amp;quot;guessing&amp;quot;
what the audience is actually seeing in my click-animation and gauging my content
from there. It was neither easy nor pleasant. 
&lt;/li&gt;
&lt;li&gt;
There was a disconnect incident in my demos that also marred the listener&amp;#39;s experience.
I had to re-login again. Not Good.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Isnt it ironic? My network connection showed&amp;nbsp;lack of reliability when I am talking
about Reliability&amp;nbsp;as a topic. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;.&amp;nbsp;Now
the least I can do is to answer a couple of questions that popped up after the session:
&lt;/p&gt;
&lt;p&gt;
Q: Is RM available for all the bindings in &lt;a href=http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx target=_blank&gt;Windows
Communication Foundation (WCF, previously - Indigo)&lt;/a&gt; ?&amp;nbsp;&lt;br /&gt;
A: &lt;strong&gt;Yes, it is available for MOST of the standard bindings in WCF. In some
bindings such as the netTcpBinding I showed, it is On-by-Default. In bindings such
as wsDualHttpBinding where you need correlation of different channels and such, it
is Always-On. It doesnt make sense to stick &amp;lt;reliableSession /&amp;gt; in a netMsmqBinding,
for example.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Q:&amp;nbsp;Is this the same&amp;nbsp;WS-RM spec&amp;nbsp;that is&amp;nbsp;authored by IBM, Microsoft
and TIBCO&amp;nbsp;?&amp;nbsp;&lt;br /&gt;
A: &lt;strong&gt;Yes. In my slide, I mentioned - I.B.M&amp;nbsp;and &lt;a href="http://www.tibco.com/" target="_blank"&gt;TIBCO&lt;/a&gt;.
I.B.M&amp;nbsp;is actually the acronym I&amp;nbsp;used for &lt;a href="http://www.ibm.com/" target="_blank"&gt;IBM&lt;/a&gt;, &lt;a href="http://www.bea.com/" target="_blank"&gt;BEA&lt;/a&gt; and &lt;a href="http://www.microsoft.com/" target="_blank"&gt;Microsoft&lt;/a&gt;. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Q:&amp;nbsp;Can I get the demo you showed?&amp;nbsp;&lt;br /&gt;
A: &lt;strong&gt;No, I am sorry.&amp;nbsp;In any case, my demos will not work with the lastest
WinFX B2 bits&amp;nbsp;today. I will need time to port them over. I recommend you go bug &lt;a href="http://blogs.msdn.com/shycohen" target="_blank"&gt;Shy&lt;/a&gt; when
you see him and ask him for his WS-RM demo which consists of a WPF stack in there
and a &amp;quot;awesomely&amp;quot; cool Rubik&amp;#39;s Cube demo and is 100x better than mine.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
All in all, it is quite a different experience than doing an on-stage presentation,
especially when you spent an hour talking to yourself and you cannot see the audience
faces and cannot manipulate your content and presentation based on their moods.
&lt;/p&gt;
&lt;p&gt;
But then again, no one can see that I am wearing my &lt;a href="http://www.treasurekingdom.com/miva/graphics/00000001/boxerlarge3.jpg" target="_blank"&gt;Mickey-Mouse
boxers&lt;/a&gt; while I am presenting, so I guess that is a good trade-off.
&lt;/p&gt;
&lt;img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=45671be1-e92e-44f8-9862-f72f472f67ee" alt="" width="0" height="0" /&gt;&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=af9c64c8-73cf-4ba2-a1b1-536a4c871dae" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Windows Communication Foundation (WCF) aka Indigo;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=83fc4d6e-6612-46a0-9111-113e759ffc83</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,83fc4d6e-6612-46a0-9111-113e759ffc83.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here I am - proud to announce that I will be doing a <a href="http://msdn.microsoft.com/" target="_blank">MSDN</a> Redmond-hosted <a href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032299329%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target="_blank">Webcast</a> right
from the other side of the hemisphere in Singapore.
</p>
        <p>
I will be speaking on concepts of Reliability in Soap:Web Services, why its needed, as
well as the context of it in <a href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">Windows
Communication Foundation (WCF, previously - Indigo)</a>.
</p>
        <p>
More importantly, a 40GB <a href="http://www.creative.com/" target="_blank">Creative</a> (another
homegrown Singapor<em>ean</em> product) ZEN MP3 player is at stake here waiting to
be won. So, do sign up quickly for a chance to win this. Rules <a href="http://www.microsoft.com/events/officialrules_mp3.mspx" target="_blank">here</a>.
</p>
        <p>
If you are one of those <a href="http://en.wikipedia.org/wiki/Insomniac_(health)" target="_blank">insomniacs</a> in
Asia-Pacific, do try to tune-in. I hope this blazes a trail for the other community
leaders in Asia-Pacific to follow suit and show that we are right on par there with
the best in technology. <img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif" /></p>
        <p>
Click <a href="http://msevents.microsoft.com/cui/eventdetail.aspx?eventID=1032299329&amp;Culture=en-US" target="_blank">here</a> for
more details on this webcast.
</p>
        <img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=85f01ab2-ee37-48c8-bd25-8f1d68347c29" alt="" width="0" height="0" />
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=83fc4d6e-6612-46a0-9111-113e759ffc83" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>MSDN Redmond Webcasting from Singapore</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,83fc4d6e-6612-46a0-9111-113e759ffc83.aspx</guid>
      <link>http://www.softwaremaker.net/blog/MSDNRedmondWebcastingFromSingapore.aspx</link>
      <pubDate>Sat, 27 May 2006 06:03:37 GMT</pubDate>
      <description>&lt;p&gt;
Here I am - proud to announce that I will be doing a &lt;a href="http://msdn.microsoft.com/" target="_blank"&gt;MSDN&lt;/a&gt; Redmond-hosted &lt;a href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032299329%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" target="_blank"&gt;Webcast&lt;/a&gt; right
from the other side of the hemisphere&amp;nbsp;in Singapore.
&lt;/p&gt;
&lt;p&gt;
I will be speaking on concepts of Reliability in Soap:Web Services, why&amp;nbsp;its needed,&amp;nbsp;as
well as the context of it in &lt;a href=http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx target=_blank&gt;Windows
Communication Foundation (WCF, previously - Indigo)&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
More importantly, a 40GB &lt;a href="http://www.creative.com/" target="_blank"&gt;Creative&lt;/a&gt; (another
homegrown Singapor&lt;em&gt;ean&lt;/em&gt; product) ZEN MP3 player is at stake here waiting to
be won. So, do sign up quickly for a chance to win this. Rules &lt;a href="http://www.microsoft.com/events/officialrules_mp3.mspx" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
If you are one of those &lt;a href="http://en.wikipedia.org/wiki/Insomniac_(health)" target="_blank"&gt;insomniacs&lt;/a&gt; in
Asia-Pacific, do try to tune-in. I hope this blazes a trail for the other community
leaders in Asia-Pacific to follow suit and show that we are right on par there with
the best in technology. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif"&gt;
&lt;/p&gt;
&lt;p&gt;
Click &lt;a href="http://msevents.microsoft.com/cui/eventdetail.aspx?eventID=1032299329&amp;amp;Culture=en-US" target="_blank"&gt;here&lt;/a&gt; for
more details on this webcast.
&lt;/p&gt;
&lt;img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=85f01ab2-ee37-48c8-bd25-8f1d68347c29" alt="" width="0" height="0" /&gt;&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=83fc4d6e-6612-46a0-9111-113e759ffc83" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Community;Presentations;Software Development;Windows Communication Foundation (WCF) aka Indigo;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=e9191220-ebe7-4f78-b771-711b4a261da2</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,e9191220-ebe7-4f78-b771-711b4a261da2.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Apache Axis2/C version 0.91 has been released via here:<br /><a href="http://ws.apache.org/axis2/c/download.cgi" target="_blank">http://ws.apache.org/axis2/c/download.cgi</a></p>
        <p>
Key Features
</p>
        <ol>
          <li>
AXIOM, an XML object model optimized for SOAP 1.1/1.2 messages with complete XML Infoset
support 
</li>
          <li>
Support for One-Way Messaging (In-Only) and Request Response Messaging (In-Out) 
</li>
          <li>
Module architecture, mechanism to extend the SOAP processing model 
</li>
          <li>
Context hierarchy 
</li>
          <li>
Directory based deployment model 
</li>
          <li>
Raw XML providers 
</li>
          <li>
WS-Addressing, both the submission (2004/08) and final (2005/08) versions 
</li>
          <li>
Transports: HTTP * Both simple axis server and Apache2 httpd module and * SSL client
transport - New 
</li>
          <li>
Service Groups - New 
</li>
          <li>
Service client and operation client APIs - New 
</li>
          <li>
REST support (POST case) - New 
</li>
          <li>
Module version support - New 
</li>
          <li>
MTOM support - New</li>
        </ol>
        <p>
Other notes
</p>
        <ol>
          <li>
Interoperability tested with Axis2/Java for XML in/out client and services 
</li>
          <li>
Addressing 1.0 interoperability</li>
        </ol>
        <p>
Major changes since last release
</p>
        <ol>
          <li>
Full Addressing 1.0 support 
</li>
          <li>
Improved fault handling model 
</li>
          <li>
SSL client transport 
</li>
          <li>
MTOM implementation 
</li>
          <li>
Implementation of easy to use service client and operation client APIs for client
side programming 
</li>
          <li>
REST support (POST case) 
</li>
          <li>
Module version support 
</li>
          <li>
Service groups 
</li>
          <li>
Numerous bug fixes since last release</li>
        </ol>
        <p>
Un-Implemented Architecture Features (TBD in 1.0)
</p>
        <ol>
          <li>
Sessions scoping for application, SOAP, transport and request levels 
</li>
          <li>
Different character encoding support 
</li>
          <li>
Dynamic invocation 
</li>
          <li>
Archive based deployment Model</li>
        </ol>
        <p>
Un-Implemented Architecture Features (TBD post 1.0)
</p>
        <ol>
          <li>
WSDL code generation tool for stub and skeletons (based on Java tool) 
</li>
          <li>
Security module 
</li>
          <li>
REST (REpresentational State Transfer) support (GET case) 
</li>
          <li>
Web Services policy support 
</li>
          <li>
Axis2 Web application (Web App)</li>
        </ol>
        <img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=43c3ff61-2a3f-449f-8e27-9cff541a6e2c" alt="" width="0" height="0" />
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=e9191220-ebe7-4f78-b771-711b4a261da2" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Thumbs up for the Apache Axis2 team</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,e9191220-ebe7-4f78-b771-711b4a261da2.aspx</guid>
      <link>http://www.softwaremaker.net/blog/ThumbsUpForTheApacheAxis2Team.aspx</link>
      <pubDate>Tue, 16 May 2006 05:59:18 GMT</pubDate>
      <description>&lt;p&gt;
Apache Axis2/C version 0.91 has been released via here:&lt;br /&gt;
&lt;a href="http://ws.apache.org/axis2/c/download.cgi" target="_blank"&gt;http://ws.apache.org/axis2/c/download.cgi&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Key Features
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
AXIOM, an XML object model optimized for SOAP 1.1/1.2 messages with complete XML Infoset
support 
&lt;/li&gt;
&lt;li&gt;
Support for One-Way Messaging (In-Only) and Request Response Messaging (In-Out) 
&lt;/li&gt;
&lt;li&gt;
Module architecture, mechanism to extend the SOAP processing model 
&lt;/li&gt;
&lt;li&gt;
Context hierarchy 
&lt;/li&gt;
&lt;li&gt;
Directory based deployment model 
&lt;/li&gt;
&lt;li&gt;
Raw XML providers 
&lt;/li&gt;
&lt;li&gt;
WS-Addressing, both the submission (2004/08) and final (2005/08) versions 
&lt;/li&gt;
&lt;li&gt;
Transports: HTTP * Both simple axis server and Apache2 httpd module and * SSL client
transport - New 
&lt;/li&gt;
&lt;li&gt;
Service Groups - New 
&lt;/li&gt;
&lt;li&gt;
Service client and operation client APIs - New 
&lt;/li&gt;
&lt;li&gt;
REST support (POST case) - New 
&lt;/li&gt;
&lt;li&gt;
Module version support - New 
&lt;/li&gt;
&lt;li&gt;
MTOM support - New&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Other notes
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Interoperability tested with Axis2/Java for XML in/out client and services 
&lt;/li&gt;
&lt;li&gt;
Addressing 1.0 interoperability&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Major changes since last release
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Full Addressing 1.0 support 
&lt;/li&gt;
&lt;li&gt;
Improved fault handling model 
&lt;/li&gt;
&lt;li&gt;
SSL client transport 
&lt;/li&gt;
&lt;li&gt;
MTOM implementation 
&lt;/li&gt;
&lt;li&gt;
Implementation of easy to use service client and operation client APIs for client
side programming 
&lt;/li&gt;
&lt;li&gt;
REST support (POST case) 
&lt;/li&gt;
&lt;li&gt;
Module version support 
&lt;/li&gt;
&lt;li&gt;
Service groups 
&lt;/li&gt;
&lt;li&gt;
Numerous bug fixes since last release&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Un-Implemented Architecture Features (TBD in 1.0)
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Sessions scoping for application, SOAP, transport and request levels 
&lt;/li&gt;
&lt;li&gt;
Different character encoding support 
&lt;/li&gt;
&lt;li&gt;
Dynamic invocation 
&lt;/li&gt;
&lt;li&gt;
Archive based deployment Model&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Un-Implemented Architecture Features (TBD post 1.0)
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
WSDL code generation tool for stub and skeletons (based on Java tool) 
&lt;/li&gt;
&lt;li&gt;
Security module 
&lt;/li&gt;
&lt;li&gt;
REST (REpresentational State Transfer) support (GET case) 
&lt;/li&gt;
&lt;li&gt;
Web Services policy support 
&lt;/li&gt;
&lt;li&gt;
Axis2 Web application (Web App)&lt;/li&gt;
&lt;/ol&gt;
&lt;img src="http://www.softwaremaker.net/blog/cptrk.ashx?id=43c3ff61-2a3f-449f-8e27-9cff541a6e2c" alt="" width="0" height="0" /&gt;&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=e9191220-ebe7-4f78-b771-711b4a261da2" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Software Development;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=12d52620-a22a-4d34-bbbf-7c5187cf6511</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,12d52620-a22a-4d34-bbbf-7c5187cf6511.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
With regards to my post <a href="http://www.softwaremaker.net/blog/WSE30WSSecurity11DigitalSignaturesEnhancements.aspx" target="_blank">here</a>,
I thought I expand on one of many enhancements that <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank">WS-Security
Specifications</a> 1.1 brings.
</p>
        <p>
"<strong><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wse3.0/html/fca47680-f703-43eb-8a7f-c5bd330102c2.asp" target="_blank">MutualCertificate11Security</a></strong>"
assertion is one of the few security turnkey assertions in <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 3.0 and what basically it is is that the client
and server are authenticated using X.509 certificates (X509SecurityToken). Message-level
security is implemented using X509SecurityToken security tokens. This turnkey security
assertion requires WS-Security 1.1
</p>
        <p>
Once that is configured and implemented properly, it is rather interesting to see
what transcends on the wire. Here is a brief snippet: 
<hr />
[wsse:Security soap:mustUnderstand="1"]<br />
...<br />
[wsse:BinarySecurityToken ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3"
EncodingType="...wss-soap-message-security-1.0#Base64Binary" wsu:Id="<font color="#ff0000">SecurityToken-76ae...</font>"]MIIBvD...[/wsse:BinarySecurityToken] 
</p>
        <p>
        </p>
        <p>
[xenc:EncryptedKey Id="<font color="#ff0000">SecurityToken-6ec8...</font>" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]<br />
[xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"]<br />
[ds:DigestMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
/] 
<br />
[/xenc:EncryptionMethod]<br />
[KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"]<br />
[wsse:SecurityTokenReference]<br />
[wsse:KeyIdentifier ValueType="...oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary"]qRTA40Xfk6w1Os3mgpgy8UgwR/Y=[/wsse:KeyIdentifier] 
<br />
[/wsse:SecurityTokenReference]<br />
[/KeyInfo]<br />
[xenc:CipherData]<br />
[xenc:CipherValue]hBfCfVmg...[/xenc:CipherValue] 
<br />
[/xenc:CipherData]<br />
[xenc:ReferenceList]<br />
...<br />
[/xenc:ReferenceList]<br />
[/xenc:EncryptedKey]
</p>
        <p>
[<font color="#ff0000">Signature Id="Sig-b679..."</font> xmlns="http://www.w3.org/2000/09/xmldsig#"]<br />
  [SignedInfo]<br />
  [ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" /] 
<br />
  [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" /] 
<br />
  [<font color="#ff0000">Reference URI="#Id-5cdc..."</font>]<br />
  ...<br />
  [/Reference]<br />
  [/SignedInfo]<br />
  [SignatureValue]O/PdsVMS4PTIBtrx8eyFNzbTnjc=[/SignatureValue] 
<br />
  [KeyInfo]<br />
  [wsse:SecurityTokenReference]<br />
  [<font color="#ff0000">wsse:Reference URI="#SecurityToken-6ec8..." ValueType="...oasis-wss-soap-message-security-1.1#EncryptedKey"
/</font>] 
<br />
  [/wsse:SecurityTokenReference]<br />
  [/KeyInfo]<br />
[/Signature]
</p>
        <p>
[<font color="#ff0000">Signature</font> xmlns="http://www.w3.org/2000/09/xmldsig#"]<br />
  [SignedInfo]<br />
  [ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" /] 
<br />
  [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /] 
<br />
  [<font color="#ff0000">Reference URI="#Sig-b679..."</font>]<br />
  ...<br />
  [/Reference]<br />
  [/SignedInfo]<br />
  [SignatureValue]PDm4wS+3hzmXugHL1wcTWZXHcaGKkODVHU48XvVNC6catxiOr25<br />
xq9AGN8u8CgYo1JlnoEf2tuCUl86krKiUBSnMR/towfAs2doGg6a+vtjIl9F54c/VZtTPgwn<br />
QdZtJ28E8+ep5MIS2i+9Tamnui6qpX16IS3J1FcMjVBHQpMs=<br />
[/SignatureValue] 
<br />
  [KeyInfo]<br />
  [wsse:SecurityTokenReference]<br />
  [<font color="#ff0000">wsse:Reference URI="#SecurityToken-76ae..." ValueType="...wss-x509-token-profile-1.0#X509v3"
/</font>] 
<br />
  [/wsse:SecurityTokenReference]<br />
  [/KeyInfo]<br />
[/Signature]<br />
... 
<hr /><br /></p>
        <p>
One thing that you will noticed is that there are 2 Digital Signatures generated.
</p>
        <p>
The first one has a ReferenceID, which hints that it will be subject to encryption/signatures
later on, and it is signed by a EncryptedKey type (which I talked about in my <a href="http://www.softwaremaker.net/blog/WSE30WSSecurity11DigitalSignaturesEnhancements.aspx" target="_blank">earlier
post</a>). Because it is encrypted by a symmetric key "#SecurityToken-6ec8", the [SignatureValue]
is rather short and this signature basically signs the soap:Body with an URI of "#Id-5cdc..."
The [EncryptedKey] value can be decrypted and derived by the server's private key
</p>
        <p>
The second signature basically signs the first signature (#Sig-b679...) and it signs
it with the Client's Private Key that only the corresponding Public Key Pair can decrypt.
The Public Key, together with the client's cert is sent over the wire via a [wsse:BinarySecurityToken]
(#SecurityToken-76ae...). Because an asymmetric key is utilized here, the [SignatureValue]
is relatively longer than the first signature.
</p>
        <p>
As we can see from here, the first signature signs the soap:Body and the second signature
signs the first signature. These are generally known as "<strong>Supporting Tokens</strong>".
These additional tokens may be specified to augment the claims provided by the token
associated with the “message signature” provided by the Security Binding. Supporting
tokens may be specified at a different scope than the binding assertion which provides
support for securing the exchange.
</p>
        <p>
There are four properties related to supporting token requirements which may be referenced
by a Security Binding: [Supporting Tokens], [Signed Supporting Tokens], [Endorsing
Supporting Tokens] and [Signed Endorsing Supporting Tokens]. Four assertions are then
defined to populate those properties: SupportingTokens, SignedSupportingTokens, EndorsingSupportingTokens,
and SignedEndorsingSupportingTokens.
</p>
        <p>
What I have shown above is known as the [<strong><u>EndorsingSupportingTokens</u></strong>].
</p>
        <p>
The [SignedEndorsingSupportingTokens] is a combination of [SignedSupportingToken]
and [EndorsingSupportingToken] and I will talk about that in a future post.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=12d52620-a22a-4d34-bbbf-7c5187cf6511" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>More on WS-Security 1.1 with WSE 3.0</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,12d52620-a22a-4d34-bbbf-7c5187cf6511.aspx</guid>
      <link>http://www.softwaremaker.net/blog/MoreOnWSSecurity11WithWSE30.aspx</link>
      <pubDate>Wed, 11 Jan 2006 17:06:42 GMT</pubDate>
      <description>&lt;p&gt;
With regards to my post &lt;a href="http://www.softwaremaker.net/blog/WSE30WSSecurity11DigitalSignaturesEnhancements.aspx" target=_blank&gt;here&lt;/a&gt;,
I thought I expand on one of&amp;nbsp;many enhancements that &lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank"&gt;WS-Security
Specifications&lt;/a&gt; 1.1 brings.
&lt;/p&gt;
&lt;p&gt;
"&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wse3.0/html/fca47680-f703-43eb-8a7f-c5bd330102c2.asp" target=_blank&gt;MutualCertificate11Security&lt;/a&gt;&lt;/strong&gt;"
assertion is one of the few security turnkey assertions in &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 3.0 and&amp;nbsp;what basically it is is that the client
and server are authenticated using X.509 certificates (X509SecurityToken). Message-level
security is implemented using X509SecurityToken security tokens. This turnkey security
assertion requires WS-Security 1.1
&lt;/p&gt;
&lt;p&gt;
Once that is configured and implemented properly, it is rather interesting to see
what transcends on the wire. Here is a brief snippet: 
&lt;hr&gt;
[wsse:Security soap:mustUnderstand="1"]&lt;br&gt;
...&lt;br&gt;
[wsse:BinarySecurityToken ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3"
EncodingType="...wss-soap-message-security-1.0#Base64Binary" wsu:Id="&lt;font color=#ff0000&gt;SecurityToken-76ae...&lt;/font&gt;"]MIIBvD...[/wsse:BinarySecurityToken] 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
[xenc:EncryptedKey Id="&lt;font color=#ff0000&gt;SecurityToken-6ec8...&lt;/font&gt;" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]&lt;br&gt;
[xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"]&lt;br&gt;
[ds:DigestMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"
/] 
&lt;br&gt;
[/xenc:EncryptionMethod]&lt;br&gt;
[KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"]&lt;br&gt;
[wsse:SecurityTokenReference]&lt;br&gt;
[wsse:KeyIdentifier ValueType="...oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary"]qRTA40Xfk6w1Os3mgpgy8UgwR/Y=[/wsse:KeyIdentifier] 
&lt;br&gt;
[/wsse:SecurityTokenReference]&lt;br&gt;
[/KeyInfo]&lt;br&gt;
[xenc:CipherData]&lt;br&gt;
[xenc:CipherValue]hBfCfVmg...[/xenc:CipherValue] 
&lt;br&gt;
[/xenc:CipherData]&lt;br&gt;
[xenc:ReferenceList]&lt;br&gt;
...&lt;br&gt;
[/xenc:ReferenceList]&lt;br&gt;
[/xenc:EncryptedKey]
&lt;/p&gt;
&lt;p&gt;
[&lt;font color=#ff0000&gt;Signature Id="Sig-b679..."&lt;/font&gt; xmlns="http://www.w3.org/2000/09/xmldsig#"]&lt;br&gt;
&amp;nbsp; [SignedInfo]&lt;br&gt;
&amp;nbsp; [ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" /] 
&lt;br&gt;
&amp;nbsp; [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" /] 
&lt;br&gt;
&amp;nbsp; [&lt;font color=#ff0000&gt;Reference URI="#Id-5cdc..."&lt;/font&gt;]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [/Reference]&lt;br&gt;
&amp;nbsp; [/SignedInfo]&lt;br&gt;
&amp;nbsp; [SignatureValue]O/PdsVMS4PTIBtrx8eyFNzbTnjc=[/SignatureValue] 
&lt;br&gt;
&amp;nbsp; [KeyInfo]&lt;br&gt;
&amp;nbsp; [wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [&lt;font color=#ff0000&gt;wsse:Reference URI="#SecurityToken-6ec8..." ValueType="...oasis-wss-soap-message-security-1.1#EncryptedKey"
/&lt;/font&gt;] 
&lt;br&gt;
&amp;nbsp; [/wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [/KeyInfo]&lt;br&gt;
[/Signature]
&lt;/p&gt;
&lt;p&gt;
[&lt;font color=#ff0000&gt;Signature&lt;/font&gt; xmlns="http://www.w3.org/2000/09/xmldsig#"]&lt;br&gt;
&amp;nbsp; [SignedInfo]&lt;br&gt;
&amp;nbsp; [ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" /] 
&lt;br&gt;
&amp;nbsp; [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /] 
&lt;br&gt;
&amp;nbsp; [&lt;font color=#ff0000&gt;Reference URI="#Sig-b679..."&lt;/font&gt;]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [/Reference]&lt;br&gt;
&amp;nbsp; [/SignedInfo]&lt;br&gt;
&amp;nbsp; [SignatureValue]PDm4wS+3hzmXugHL1wcTWZXHcaGKkODVHU48XvVNC6catxiOr25&lt;br&gt;
xq9AGN8u8CgYo1JlnoEf2tuCUl86krKiUBSnMR/towfAs2doGg6a+vtjIl9F54c/VZtTPgwn&lt;br&gt;
QdZtJ28E8+ep5MIS2i+9Tamnui6qpX16IS3J1FcMjVBHQpMs=&lt;br&gt;
[/SignatureValue] 
&lt;br&gt;
&amp;nbsp; [KeyInfo]&lt;br&gt;
&amp;nbsp; [wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [&lt;font color=#ff0000&gt;wsse:Reference URI="#SecurityToken-76ae..." ValueType="...wss-x509-token-profile-1.0#X509v3"
/&lt;/font&gt;] 
&lt;br&gt;
&amp;nbsp; [/wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [/KeyInfo]&lt;br&gt;
[/Signature]&lt;br&gt;
... 
&lt;hr&gt;
&lt;br&gt;
&lt;p&gt;
One thing that you will noticed is that there are 2 Digital Signatures generated.
&lt;/p&gt;
&lt;p&gt;
The first one has a ReferenceID, which hints that it will be subject to encryption/signatures
later on, and it is signed by a EncryptedKey type (which I talked about in my &lt;a href="http://www.softwaremaker.net/blog/WSE30WSSecurity11DigitalSignaturesEnhancements.aspx" target=_blank&gt;earlier
post&lt;/a&gt;). Because it is encrypted by a symmetric key "#SecurityToken-6ec8", the [SignatureValue]
is rather short and this signature basically signs the soap:Body with an URI of "#Id-5cdc..."
The [EncryptedKey] value can be decrypted and derived by the server's private key
&lt;/p&gt;
&lt;p&gt;
The second signature basically signs the first signature (#Sig-b679...) and it signs
it with the Client's Private Key that only the corresponding Public Key Pair can decrypt.
The Public Key, together with the client's cert is sent over the wire via a [wsse:BinarySecurityToken]
(#SecurityToken-76ae...). Because an asymmetric key is utilized here, the [SignatureValue]
is relatively longer than the first signature.
&lt;/p&gt;
&lt;p&gt;
As we can see from here, the first signature signs the soap:Body and the second signature
signs the first signature. These are generally known as "&lt;strong&gt;Supporting Tokens&lt;/strong&gt;".
These additional tokens may be specified to augment the claims provided by the token
associated with the “message signature” provided by the Security Binding. Supporting
tokens may be specified at a different scope than the binding assertion which provides
support for securing the exchange.
&lt;/p&gt;
&lt;p&gt;
There are four properties related to supporting token requirements which may be referenced
by a Security Binding: [Supporting Tokens], [Signed Supporting Tokens], [Endorsing
Supporting Tokens] and [Signed Endorsing Supporting Tokens]. Four assertions are then
defined to populate those properties: SupportingTokens, SignedSupportingTokens, EndorsingSupportingTokens,
and SignedEndorsingSupportingTokens.
&lt;/p&gt;
&lt;p&gt;
What I have shown above is known as the [&lt;strong&gt;&lt;u&gt;EndorsingSupportingTokens&lt;/u&gt;&lt;/strong&gt;].
&lt;/p&gt;
&lt;p&gt;
The [SignedEndorsingSupportingTokens] is a combination of [SignedSupportingToken]
and [EndorsingSupportingToken] and I will talk about that in a future post.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=12d52620-a22a-4d34-bbbf-7c5187cf6511" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=602b3d22-c86a-4d07-af96-71016065605c</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,602b3d22-c86a-4d07-af96-71016065605c.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have been back fiddling at the <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 3.0 technology space for the past few weeks and I
am now grokking into the plumbings since there are quite a few forums, blogs, posts
out there focusing on the higher-level abstract programming model.
</p>
        <p>
I am very pleased that WSE 3.0 has implemented <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank">WS-Security
Specifications</a> 1.1 at its very core, so much so that it is the de-facto security
standard to be used in most of the <a href="http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx?pull=/msdnmag/issues/05/11/securitybriefs/default.aspx" target="_blank">Turnkey
Security Assertions</a> that comes with the product.
</p>
        <p>
One of the things that I have always been asking for through my contacts and channels
in the <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss" target="_blank">OASIS
WS-Security Technical Committee</a> is the ability to sign my document snippets
with a symmetric key instead. Since <a href="http://www.w3.org/TR/xmlenc-core/" target="_blank">XML-Encryption</a> already
utilized symmetric key encryption via the [xenc:EncryptedKey] [1] for performance
and throughput reasons, there is no reason why <a href="http://www.w3.org/TR/xmldsig-core/" target="_blank">XML-Digital
Signature</a> cannot do the same. While the improvements in throughput may be slight
due to the fact that in digital signatures, messages are already hashed before encryption,
it is still a viable option that should be made available.
</p>
        <p>
          <strong>In WS-Security 1.0, this is what is commonly seen in the Digital Signature
Parts:</strong>
          <hr />
...<br />
[wsse:BinarySecurityToken ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary" 
<br />
wsu:Id="SecurityToken-7b5d..."]MIIBxDCCAW...[/wsse:BinarySecurityToken]<br />
 <br />
  [Signature xmlns="http://www.w3.org/2000/09/xmldsig#"]<br />
  [SignedInfo]<br />
  [CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
/] 
<br />
  [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /] 
<br />
  [Reference URI="#Id-f7e1..."]<br />
  [Transforms]<br />
  [Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /] 
<br />
  [/Transforms]<br />
  [DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /] 
<br />
  [DigestValue]avMezj5NhZwNerXidi5oBmjqi/g=[/DigestValue] 
<br />
  [/Reference]<br />
  ...<br />
  [/SignedInfo] 
</p>
        <p>
        </p>
        <p>
[SignatureValue]<strong><em><font color="#ff0000">SJfnqZeDHboWDI2n2gWHqTJO5hXvZOFQw8UtDdajktzR40H+W6D<br />
prs5CW/l9A5TF3xcFfyryA3hz7c+0vdlZSnaA+cBn2qPxt7/YmwaAx5Ave<br />
awuach6YPYI123I4I3f58eSMUgPsx6/uuFQFcJltEMw1nWLE6Wb6CPg5OdtXLs=</font></em></strong>[/SignatureValue] 
<br />
  [KeyInfo]<br />
  [wsse:SecurityTokenReference]<br />
  [wsse:Reference URI="#SecurityToken-7b5d..."<br />
ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3" /] 
<br />
  [/wsse:SecurityTokenReference]<br />
  [/KeyInfo]<br />
  [/Signature] 
<hr /></p>
        <p>
          <strong>Now in WS-Security 1.1 via WSE 3.0, I can do this:</strong>
          <hr />
[xenc:EncryptedKey Id="SecurityToken-32e4..." xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]<br />
  ...<br />
  [wsse:SecurityTokenReference]<br />
    [wsse:KeyIdentifier ValueType="...oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary"]qRTA40Xfk6w1Os3mgpgy8UgwR/Y=[/wsse:KeyIdentifier] 
<br />
  [/wsse:SecurityTokenReference]<br />
  [/KeyInfo] 
</p>
        <p>
        </p>
        <p>
[xenc:CipherData]  
<br />
[xenc:CipherValue]n6PnkIWb+QsIeOPehLdtQQKYZn202uGqhN+ShCWyBaCf20rmVcta<br />
Bw2MhB1fv9pE0hOLpAxMMT5ffk4/hnwZ/ef2XcZediF6ySfpse14TI2TGy<br />
cp9XErpeYlZNn1wSchHlOEz2gVYfViZoEOIwn8qR7EofLN3U3Mc5Zp2qG2coI=[/xenc:CipherValue] 
<br />
  [/xenc:CipherData]<br />
  [xenc:ReferenceList]<br />
  [xenc:DataReference URI="#Enc-0914..." /] 
<br />
  [xenc:DataReference URI="#Enc-3aab..." /] 
<br />
  [/xenc:ReferenceList]<br />
  [/xenc:EncryptedKey]<br />
  [xenc:EncryptedData Id="Enc-0914..." Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]<br />
  [xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/] 
<br />
  [xenc:CipherData]  [xenc:CipherValue]RLASn...[/xenc:CipherValue] 
<br />
  [/xenc:CipherData]<br />
  [/xenc:EncryptedData]
</p>
        <p>
[Signature xmlns="http://www.w3.org/2000/09/xmldsig#"]<br />
  [SignedInfo]<br />
  ...<br />
  [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" /] 
<br />
  [Reference URI="#SecurityToken-d217..."]<br />
  [Transforms]<br />
  [Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /] 
<br />
  [/Transforms]<br />
  [DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /] 
<br />
  [DigestValue]A0K7OVwZN3vP4rIXfbTZYy+f+ck=[/DigestValue] 
<br />
  [/Reference]<br />
  [Reference URI="#Timestamp-6f12..."]<br />
  ...<br />
  [/Reference]<br />
  [/SignedInfo]<br />
  [SignatureValue]<strong><em><font color="#ff0000">d8KmXpfspmKiEOZ1eBVY7mk05Wo=</font></em></strong>[/SignatureValue] 
<br />
  [KeyInfo]<br />
  [wsse:SecurityTokenReference]<br />
  [wsse:Reference URI="#SecurityToken-32e4..." 
<br />
ValueType="...<strong><em><font color="#ff0000">oasis-wss-soap-message-security-1.1#EncryptedKey</font></em></strong>"
/] 
<br />
  [/wsse:SecurityTokenReference]<br />
  [/KeyInfo]<br />
[/Signature] 
<hr /></p>
        <p>
        </p>
        <p>
Note the fonts in RED. There is a new URI: <strong>http://docs.oasisopen.org/wss/oasiswss-soap-messagesecurity-1.1#EncryptedKey</strong> which
ties to a ValueType: <strong>A token type of an [xenc:EncryptedKey]</strong></p>
        <p>
... and more importantly ...
</p>
        <p>
the <strong>[SignatureValue]</strong> contents is slightly shorter now because it
is actually encrypted with a symmetric key now. I know I may be picking here
BUT hey, even a single byte in reduction means a lot in throughput performance in
terms of wire transfer of documents. <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" />.
</p>
        <p>
There are other improvements WS-Security 1.1 brings over its predecessor 1.0, which
I will blog more about as I go along.
</p>
        <p>
[1] Just a note to defuse any confusion if it crops up: Asymmetric (Public-Private)
key technologies are still very much used in WS-Security and other document-related
security specifications today. I dont think it will be dropped anytime soon unless <a href="http://en.wikipedia.org/wiki/Quantum_cryptography" target="_blank">Quantum
Cryptography</a> takes off <em>mainstream</em> in a big way or the subtle effects
of <a href="http://www.cnn.com/2006/EDUCATION/01/04/largest.prime.number.ap/index.html" target="_blank">this</a> reverberates
adversely through the security space. Having said that, Symmetric (Master/Session)
key technologies have a huge place in the security specifications world too, just
by the fact that it is a 1000x faster than much-secure asymmetric ones. Therefore,
both technologies co-exist and work very well together in the document security space.
To put it simply, a symmetric key (KeyA) is randomly-generated (key-length can be
specified by the application - the longer, the better) and then used to encrypt/decrypt
messages (MsgA). Once that is done - KeyA is then subsequently encrypted by an asymmetric
key (KeyB) and then transmitted through the message. Only the holder of the Private-Key
pair of KeyB will be able to decrypt KeyA which can then decrypt/encrypt MsgA.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=602b3d22-c86a-4d07-af96-71016065605c" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>WSE 3.0 (WS-Security 1.1) Digital Signatures Enhancements</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,602b3d22-c86a-4d07-af96-71016065605c.aspx</guid>
      <link>http://www.softwaremaker.net/blog/WSE30WSSecurity11DigitalSignaturesEnhancements.aspx</link>
      <pubDate>Mon, 09 Jan 2006 21:41:51 GMT</pubDate>
      <description>&lt;p&gt;
I have been back fiddling at the &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 3.0 technology space for the past few weeks and I
am now grokking into the plumbings since there are quite a few forums, blogs, posts
out there focusing on the higher-level abstract programming model.
&lt;/p&gt;
&lt;p&gt;
I am very pleased that WSE 3.0 has implemented &lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank"&gt;WS-Security
Specifications&lt;/a&gt; 1.1 at its very core, so much so that it is the de-facto security
standard to be used in most of the &lt;a href="http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx?pull=/msdnmag/issues/05/11/securitybriefs/default.aspx" target=_blank&gt;Turnkey
Security Assertions&lt;/a&gt;&amp;nbsp;that comes with the product.
&lt;/p&gt;
&lt;p&gt;
One of the things that I have always been asking for through my contacts and channels
in&amp;nbsp;the &lt;a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss" target=_blank&gt;OASIS
WS-Security Technical Committee&lt;/a&gt;&amp;nbsp;is the ability to sign my document snippets
with a symmetric key instead. Since &lt;a href="http://www.w3.org/TR/xmlenc-core/" target="_blank"&gt;XML-Encryption&lt;/a&gt; already
utilized symmetric key encryption via the [xenc:EncryptedKey] [1] for performance
and throughput&amp;nbsp;reasons, there is no reason why &lt;a href="http://www.w3.org/TR/xmldsig-core/" target="_blank"&gt;XML-Digital
Signature&lt;/a&gt; cannot do the same. While the improvements in throughput may be slight
due to the fact that in digital signatures, messages are already hashed before encryption,
it is still a viable option that should be made available.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In WS-Security 1.0, this is what is commonly seen in the Digital Signature
Parts:&lt;/strong&gt; 
&lt;hr&gt;
...&lt;br&gt;
[wsse:BinarySecurityToken ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary" 
&lt;br&gt;
wsu:Id="SecurityToken-7b5d..."]MIIBxDCCAW...[/wsse:BinarySecurityToken]&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp; [Signature xmlns="http://www.w3.org/2000/09/xmldsig#"]&lt;br&gt;
&amp;nbsp; [SignedInfo]&lt;br&gt;
&amp;nbsp; [CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
/] 
&lt;br&gt;
&amp;nbsp; [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /] 
&lt;br&gt;
&amp;nbsp; [Reference URI="#Id-f7e1..."]&lt;br&gt;
&amp;nbsp; [Transforms]&lt;br&gt;
&amp;nbsp; [Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /] 
&lt;br&gt;
&amp;nbsp; [/Transforms]&lt;br&gt;
&amp;nbsp; [DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /] 
&lt;br&gt;
&amp;nbsp; [DigestValue]avMezj5NhZwNerXidi5oBmjqi/g=[/DigestValue] 
&lt;br&gt;
&amp;nbsp; [/Reference]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [/SignedInfo] 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
[SignatureValue]&lt;strong&gt;&lt;em&gt;&lt;font color=#ff0000&gt;SJfnqZeDHboWDI2n2gWHqTJO5hXvZOFQw8UtDdajktzR40H+W6D&lt;br&gt;
prs5CW/l9A5TF3xcFfyryA3hz7c+0vdlZSnaA+cBn2qPxt7/YmwaAx5Ave&lt;br&gt;
awuach6YPYI123I4I3f58eSMUgPsx6/uuFQFcJltEMw1nWLE6Wb6CPg5OdtXLs=&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;[/SignatureValue] 
&lt;br&gt;
&amp;nbsp; [KeyInfo]&lt;br&gt;
&amp;nbsp; [wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [wsse:Reference URI="#SecurityToken-7b5d..."&lt;br&gt;
ValueType="...oasis-200401-wss-x509-token-profile-1.0#X509v3" /] 
&lt;br&gt;
&amp;nbsp; [/wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [/KeyInfo]&lt;br&gt;
&amp;nbsp; [/Signature] 
&lt;hr&gt;
&lt;p&gt;
&lt;strong&gt;Now in WS-Security 1.1 via WSE 3.0, I can do this:&lt;/strong&gt; 
&lt;hr&gt;
[xenc:EncryptedKey Id="SecurityToken-32e4..." xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [wsse:KeyIdentifier ValueType="...oasis-wss-soap-message-security-1.1#ThumbprintSHA1"
EncodingType="...oasis-200401-wss-soap-message-security-1.0#Base64Binary"]qRTA40Xfk6w1Os3mgpgy8UgwR/Y=[/wsse:KeyIdentifier] 
&lt;br&gt;
&amp;nbsp; [/wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [/KeyInfo] 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
[xenc:CipherData]&amp;nbsp; 
&lt;br&gt;
[xenc:CipherValue]n6PnkIWb+QsIeOPehLdtQQKYZn202uGqhN+ShCWyBaCf20rmVcta&lt;br&gt;
Bw2MhB1fv9pE0hOLpAxMMT5ffk4/hnwZ/ef2XcZediF6ySfpse14TI2TGy&lt;br&gt;
cp9XErpeYlZNn1wSchHlOEz2gVYfViZoEOIwn8qR7EofLN3U3Mc5Zp2qG2coI=[/xenc:CipherValue] 
&lt;br&gt;
&amp;nbsp; [/xenc:CipherData]&lt;br&gt;
&amp;nbsp; [xenc:ReferenceList]&lt;br&gt;
&amp;nbsp; [xenc:DataReference URI="#Enc-0914..." /] 
&lt;br&gt;
&amp;nbsp; [xenc:DataReference URI="#Enc-3aab..." /] 
&lt;br&gt;
&amp;nbsp; [/xenc:ReferenceList]&lt;br&gt;
&amp;nbsp; [/xenc:EncryptedKey]&lt;br&gt;
&amp;nbsp; [xenc:EncryptedData Id="Enc-0914..." Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"]&lt;br&gt;
&amp;nbsp; [xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"
/] 
&lt;br&gt;
&amp;nbsp; [xenc:CipherData]&amp;nbsp; [xenc:CipherValue]RLASn...[/xenc:CipherValue] 
&lt;br&gt;
&amp;nbsp; [/xenc:CipherData]&lt;br&gt;
&amp;nbsp; [/xenc:EncryptedData]
&lt;/p&gt;
&lt;p&gt;
[Signature xmlns="http://www.w3.org/2000/09/xmldsig#"]&lt;br&gt;
&amp;nbsp; [SignedInfo]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" /] 
&lt;br&gt;
&amp;nbsp; [Reference URI="#SecurityToken-d217..."]&lt;br&gt;
&amp;nbsp; [Transforms]&lt;br&gt;
&amp;nbsp; [Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /] 
&lt;br&gt;
&amp;nbsp; [/Transforms]&lt;br&gt;
&amp;nbsp; [DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /] 
&lt;br&gt;
&amp;nbsp; [DigestValue]A0K7OVwZN3vP4rIXfbTZYy+f+ck=[/DigestValue] 
&lt;br&gt;
&amp;nbsp; [/Reference]&lt;br&gt;
&amp;nbsp; [Reference URI="#Timestamp-6f12..."]&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; [/Reference]&lt;br&gt;
&amp;nbsp; [/SignedInfo]&lt;br&gt;
&amp;nbsp; [SignatureValue]&lt;strong&gt;&lt;em&gt;&lt;font color=#ff0000&gt;d8KmXpfspmKiEOZ1eBVY7mk05Wo=&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;[/SignatureValue] 
&lt;br&gt;
&amp;nbsp; [KeyInfo]&lt;br&gt;
&amp;nbsp; [wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [wsse:Reference URI="#SecurityToken-32e4..." 
&lt;br&gt;
ValueType="...&lt;strong&gt;&lt;em&gt;&lt;font color=#ff0000&gt;oasis-wss-soap-message-security-1.1#EncryptedKey&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;"
/] 
&lt;br&gt;
&amp;nbsp; [/wsse:SecurityTokenReference]&lt;br&gt;
&amp;nbsp; [/KeyInfo]&lt;br&gt;
[/Signature] 
&lt;hr&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Note the fonts in RED. There is a new URI: &lt;strong&gt;http://docs.oasisopen.org/wss/oasiswss-soap-messagesecurity-1.1#EncryptedKey&lt;/strong&gt;&amp;nbsp;which
ties to a ValueType: &lt;strong&gt;A token type of an [xenc:EncryptedKey]&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
... and more importantly ...
&lt;/p&gt;
&lt;p&gt;
the &lt;strong&gt;[SignatureValue]&lt;/strong&gt; contents is slightly shorter now because it
is actually encrypted with a symmetric key now. I know I may be&amp;nbsp;picking here
BUT hey, even a single byte in reduction means a lot in throughput performance in
terms of wire transfer of documents. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;.
&lt;/p&gt;
&lt;p&gt;
There are other improvements WS-Security 1.1 brings over its predecessor 1.0, which
I will blog more about as I go along.
&lt;/p&gt;
&lt;p&gt;
[1] Just a note to defuse any confusion if it crops up: Asymmetric (Public-Private)
key technologies are still very much used in WS-Security and other document-related
security specifications today. I dont think it will be dropped anytime soon unless &lt;a href="http://en.wikipedia.org/wiki/Quantum_cryptography" target=_blank&gt;Quantum
Cryptography&lt;/a&gt;&amp;nbsp;takes off &lt;em&gt;mainstream&lt;/em&gt; in a big way or the subtle effects
of &lt;a href="http://www.cnn.com/2006/EDUCATION/01/04/largest.prime.number.ap/index.html" target=_blank&gt;this&lt;/a&gt; reverberates
adversely through the security space. Having said that, Symmetric (Master/Session)
key technologies have a huge place in the security specifications world too, just
by the fact that it is a 1000x faster than much-secure asymmetric ones. Therefore,
both technologies co-exist and work very well together in the document security space.
To put it simply, a symmetric key (KeyA) is randomly-generated (key-length can be
specified by the application - the longer, the better) and then used to encrypt/decrypt
messages (MsgA). Once that is done - KeyA is then subsequently encrypted by an asymmetric
key (KeyB) and then transmitted through the message. Only the holder of the Private-Key
pair of KeyB will be able to decrypt KeyA which can then decrypt/encrypt&amp;nbsp;MsgA.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=602b3d22-c86a-4d07-af96-71016065605c" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=efb7a1e0-b67f-4ff6-acef-618816a086e1</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,efb7a1e0-b67f-4ff6-acef-618816a086e1.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 2.0, one could exercise some control over what one
xml element/fragments wants to encrypt within a <strong>soap:Body</strong>. Therefore,
if I wanted to encrypt the account string in my credit card type, I could do something
like this:
</p>
        <p>
[At your Service Side] 
<hr />
Public Class SecuredCreditCard<br />
  &lt;XmlElement(ElementName:="CreditCardType")&gt; _<br />
  Public Type As String<br />
  &lt;XmlElement(ElementName:="CreditCardAccount")&gt; _<br />
  Public Account As SecuredString<br />
End Class 
</p>
        <p>
        </p>
        <p>
Public Class SecuredString<br />
  'Set the Oasis Id that our security reference will point to<br />
  &lt;XmlAttributeAttribute("Id", _<br />
Namespace:=".../2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")&gt; _<br />
  Public ID As String<br />
  &lt;XmlText()&gt; _<br />
  Public Data As String<br />
End Class
</p>
        <p>
[At your Calling side] 
<hr />
Dim a As localhost.IndexWse = New localhost.IndexWse<br />
Dim b As localhost.SecuredCreditCard = New localhost.SecuredCreditCard<br />
Dim z As localhost.SecuredString = New localhost.SecuredString 
</p>
        <p>
        </p>
        <p>
Dim c As SoapContext = a.RequestSoapContext
</p>
        <p>
b.CreditCardType = "VISA"<br />
z.Id = "uri:demoId.softwaremaker.net" 'or some guid<br />
z.Value = "123-456-789"<br />
b.CreditCardAccount = z
</p>
        <p>
c.Security.Elements.Add(New EncryptedData(tok, "#uri:demoId.softwaremaker.net"))
</p>
        <p>
Note: To reduce headache-inducing typo bugs, you may want to use some WSE Constants
such as 
<br />
WSUtility.Prefix<br />
WSUtility.AttributeNames.Id<br />
WSUtility.NamespaceURI
</p>
        <p>
The end result of this is a soap:Body on the wire looks like this: 
<hr />
&lt;SecureCreditCard&gt;<br />
 &lt;CreditCardType&gt;VISA&lt;/CreditCardType&gt;<br />
 &lt;CreditCardAccount d4p1:Id="uri:demoId.softwaremaker.net" xmlns:d4p1=".../2004/01/oasis- 200401-wss-wssecurity-utility-1.0.xsd"&gt;<br />
  &lt;xenc:EncryptedData Id="EncryptedContent-3d793117-f020-4236-a0a0-0ed545d9bf1a"
Type=".../2001/04/  xmlenc#Content" xmlns:xenc=".../2001/04/xmlenc#"&gt;<br />
  &lt;xenc:EncryptionMethod Algorithm=".../2001/04/xmlenc#aes128-cbc" /&gt;<br />
  &lt;xenc:CipherData&gt;<br />
  &lt;xenc:CipherValue&gt;FRFCiq...+0W5oS4&lt;/xenc:CipherValue&gt;<br />
  &lt;/xenc:CipherData&gt;<br />
  &lt;/xenc:EncryptedData&gt;<br />
 &lt;/CreditCardAccount&gt;<br />
&lt;/SecureCreditCard&gt; 
</p>
        <p>
        </p>
        <p>
While I dont know how much of performance benefits this has over one that has the
entire SecureCreditCard encrypted (since it is an symmetric-key encryption at its
core), I think in terms of latency and throughput, it does offer some benefits especially
with a sizable payload (&gt;20-30 kb, for instance ?)
</p>
        <p>
          <a href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">Windows
Communication Foundation (WCF, previously - Indigo)</a> does not currently have that
feature build in at the moment (Sept05-CTP or known as the PDC-bits). In other words,
in WCF today, you encrypt the entire contents of the <strong>soap:Body</strong>, lock-stock-barrel.
I would still love that WSE feature in there: To be able to exercise finer grain control
over what I want to or not to encrypt within a <strong>soap:Body</strong>.
</p>
        <p>
Would really like to find out if I am the only odd one out there. Any users using
that existing WSE feature out there that would love to see the same in WCF or do you
have other better ideas ? Leave a comment or email me via the contact link on the
side. Thank you.
</p>
        <p>
          <strong>
            <font color="#ff0000">BTW: Whether you encrypt certain elements of the
contents or encrypt the entire contents of the soap:Body, both are <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank">WS-Security
Specifications</a> compliant</font>
          </strong>.<br />
 
</p>
        <p>
        </p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=efb7a1e0-b67f-4ff6-acef-618816a086e1" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Encrypting message fragments in a soap:body : Evidence and Feedback needed !</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,efb7a1e0-b67f-4ff6-acef-618816a086e1.aspx</guid>
      <link>http://www.softwaremaker.net/blog/EncryptingMessageFragmentsInASoapbodyEvidenceAndFeedbackNeeded.aspx</link>
      <pubDate>Mon, 24 Oct 2005 13:00:00 GMT</pubDate>
      <description>&lt;p&gt;
In &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 2.0, one could exercise some control over what one
xml element/fragments wants to encrypt within a &lt;strong&gt;soap:Body&lt;/strong&gt;. Therefore,
if I wanted to encrypt the account string in my credit card type, I could do something
like this:
&lt;/p&gt;
&lt;p&gt;
[At your Service Side] 
&lt;hr&gt;
Public Class SecuredCreditCard&lt;br&gt;
&amp;nbsp; &amp;lt;XmlElement(ElementName:="CreditCardType")&amp;gt; _&lt;br&gt;
&amp;nbsp; Public Type As String&lt;br&gt;
&amp;nbsp; &amp;lt;XmlElement(ElementName:="CreditCardAccount")&amp;gt; _&lt;br&gt;
&amp;nbsp; Public Account As SecuredString&lt;br&gt;
End Class 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Public Class SecuredString&lt;br&gt;
&amp;nbsp; 'Set the Oasis Id that our security reference will point to&lt;br&gt;
&amp;nbsp; &amp;lt;XmlAttributeAttribute("Id", _&lt;br&gt;
Namespace:=".../2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")&amp;gt; _&lt;br&gt;
&amp;nbsp; Public ID As String&lt;br&gt;
&amp;nbsp; &amp;lt;XmlText()&amp;gt; _&lt;br&gt;
&amp;nbsp; Public Data As String&lt;br&gt;
End Class
&lt;/p&gt;
&lt;p&gt;
[At your Calling side] 
&lt;hr&gt;
Dim a As localhost.IndexWse = New localhost.IndexWse&lt;br&gt;
Dim b As localhost.SecuredCreditCard = New localhost.SecuredCreditCard&lt;br&gt;
Dim z As localhost.SecuredString = New localhost.SecuredString 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Dim c As SoapContext = a.RequestSoapContext
&lt;/p&gt;
&lt;p&gt;
b.CreditCardType = "VISA"&lt;br&gt;
z.Id = "uri:demoId.softwaremaker.net" 'or some guid&lt;br&gt;
z.Value = "123-456-789"&lt;br&gt;
b.CreditCardAccount = z
&lt;/p&gt;
&lt;p&gt;
c.Security.Elements.Add(New EncryptedData(tok, "#uri:demoId.softwaremaker.net"))
&lt;/p&gt;
&lt;p&gt;
Note: To reduce headache-inducing typo bugs, you may want to use some WSE Constants
such as 
&lt;br&gt;
WSUtility.Prefix&lt;br&gt;
WSUtility.AttributeNames.Id&lt;br&gt;
WSUtility.NamespaceURI
&lt;/p&gt;
&lt;p&gt;
The end result of this is a soap:Body on the wire looks like this: 
&lt;hr&gt;
&amp;lt;SecureCreditCard&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;CreditCardType&amp;gt;VISA&amp;lt;/CreditCardType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;CreditCardAccount d4p1:Id="uri:demoId.softwaremaker.net" xmlns:d4p1=".../2004/01/oasis-&amp;nbsp;200401-wss-wssecurity-utility-1.0.xsd"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;xenc:EncryptedData Id="EncryptedContent-3d793117-f020-4236-a0a0-0ed545d9bf1a"
Type=".../2001/04/&amp;nbsp;&amp;nbsp;xmlenc#Content" xmlns:xenc=".../2001/04/xmlenc#"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;xenc:EncryptionMethod Algorithm=".../2001/04/xmlenc#aes128-cbc" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;xenc:CipherData&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;xenc:CipherValue&amp;gt;FRFCiq...+0W5oS4&amp;lt;/xenc:CipherValue&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/xenc:CipherData&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/xenc:EncryptedData&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/CreditCardAccount&amp;gt;&lt;br&gt;
&amp;lt;/SecureCreditCard&amp;gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
While I dont know how much of performance benefits this has over one that has the
entire SecureCreditCard encrypted (since it is an symmetric-key encryption at its
core), I think in terms of latency and throughput, it does offer some benefits especially
with a sizable payload (&amp;gt;20-30 kb, for instance ?)
&lt;/p&gt;
&lt;p&gt;
&lt;a href=http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx target=_blank&gt;Windows
Communication Foundation (WCF, previously - Indigo)&lt;/a&gt; does not currently have that
feature build in at the moment (Sept05-CTP or known as the PDC-bits). In other words,
in WCF today, you encrypt the entire contents of the &lt;strong&gt;soap:Body&lt;/strong&gt;, lock-stock-barrel.
I would still love that WSE feature in there: To be able to exercise finer grain control
over what I want to or not to encrypt within a &lt;strong&gt;soap:Body&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Would really like to find out if I am the only odd one out there. Any users using
that existing WSE feature out there that would love to see the same in WCF or do you
have other better ideas ? Leave a comment or email me via the contact link on the
side. Thank you.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font color=#ff0000&gt;BTW:&amp;nbsp;Whether you encrypt certain elements of the
contents or&amp;nbsp;encrypt the entire contents of the soap:Body, both are&amp;nbsp;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank"&gt;WS-Security
Specifications&lt;/a&gt; compliant&lt;/font&gt;&lt;/strong&gt;.&lt;br&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=efb7a1e0-b67f-4ff6-acef-618816a086e1" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);Windows Communication Foundation (WCF) aka Indigo;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=3ae671c3-af70-4e23-94b0-496f59db28a4</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,3ae671c3-af70-4e23-94b0-496f59db28a4.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Another speaking assignment that landed at my desk is for me to talk about "Web Services
Security: How to track along the Security Standards Jungle" on the 21 October 2005
</p>
        <p>
Somehow, I tend to attact the dry topics <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" />.
This event is owned by <a href="http://www.oasis-open.org" target="_blank">OASIS</a> and <a href="http://www.xmlone.org/" target="_blank">XMLOne
Usergroup</a>. More information can be found <a href="http://www.xmlone.org/oasis-event.htm" target="_blank">here</a>.
</p>
        <p>
If you are around the vicinity, do feel free to drop by and catch up.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=3ae671c3-af70-4e23-94b0-496f59db28a4" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Speaking in OASIS Open Standards Day (OASIS OSD) 2005</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,3ae671c3-af70-4e23-94b0-496f59db28a4.aspx</guid>
      <link>http://www.softwaremaker.net/blog/SpeakingInOASISOpenStandardsDayOASISOSD2005.aspx</link>
      <pubDate>Wed, 05 Oct 2005 00:52:22 GMT</pubDate>
      <description>&lt;p&gt;
Another speaking assignment that landed at my desk is for me to talk about "Web Services
Security: How to track along the Security Standards Jungle" on the 21 October 2005
&lt;/p&gt;
&lt;p&gt;
Somehow, I tend to attact the dry topics &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;.
This event is owned by &lt;a href="http://www.oasis-open.org" target="_blank"&gt;OASIS&lt;/a&gt; and &lt;a href="http://www.xmlone.org/" target=_blank&gt;XMLOne
Usergroup&lt;/a&gt;. More information can be found &lt;a href="http://www.xmlone.org/oasis-event.htm" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
If you are around the vicinity, do feel free to drop by and catch up.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=3ae671c3-af70-4e23-94b0-496f59db28a4" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Community;Presentations;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=52091daf-294d-439d-8294-88fc40346d58</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,52091daf-294d-439d-8294-88fc40346d58.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <a href="http://lists.oasis-open.org/archives/members/200507/msg00002.html" target="_blank">It
is about time</a>.<img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=52091daf-294d-439d-8294-88fc40346d58" /><br /><hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>OASIS WS-Security 1.1 is open for public review</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,52091daf-294d-439d-8294-88fc40346d58.aspx</guid>
      <link>http://www.softwaremaker.net/blog/OASISWSSecurity11IsOpenForPublicReview.aspx</link>
      <pubDate>Wed, 20 Jul 2005 22:38:17 GMT</pubDate>
      <description>&lt;a href="http://lists.oasis-open.org/archives/members/200507/msg00002.html" target=_blank&gt;It
is about time&lt;/a&gt;.&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=52091daf-294d-439d-8294-88fc40346d58" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=9a8c6e40-de94-4255-92f5-54bd6034a138</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,9a8c6e40-de94-4255-92f5-54bd6034a138.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">I hope <a href="http://www.microsoft.com/presspass/press/2005/apr05/04-19OasisStandardizationPR.asp" target="_blank">this</a> turns
out better than <a href="http://www.webservices.org/index.php/ws/content/view/full/2755" target="_blank">this</a>.<img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=9a8c6e40-de94-4255-92f5-54bd6034a138" /><br /><hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>BEA, IBM, Microsoft and TIBCO submit Web Services ReliableMessaging (WS-RM) Specification to OASIS for Standardization</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,9a8c6e40-de94-4255-92f5-54bd6034a138.aspx</guid>
      <link>http://www.softwaremaker.net/blog/BEAIBMMicrosoftAndTIBCOSubmitWebServicesReliableMessagingWSRMSpecificationToOASISForStandardization.aspx</link>
      <pubDate>Sat, 21 May 2005 18:53:09 GMT</pubDate>
      <description>I hope &lt;a href="http://www.microsoft.com/presspass/press/2005/apr05/04-19OasisStandardizationPR.asp" target=_blank&gt;this&lt;/a&gt; turns
out better than &lt;a href="http://www.webservices.org/index.php/ws/content/view/full/2755" target=_blank&gt;this&lt;/a&gt;.&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=9a8c6e40-de94-4255-92f5-54bd6034a138" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>WS-Splat Specs</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=ec0da41c-646a-447c-8a7e-818662548199</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,ec0da41c-646a-447c-8a7e-818662548199.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Benjamin <a href="http://benjaminm.net/PermaLink.aspx?guid=662d151b-8c56-48c6-a23a-7372cd3a1fcb" target="_blank">points
to</a> a <a href="http://research.microsoft.com/research/downloads/download.aspx?FUID={82F07E5E-539B-47ED-A2D2-6F30FFA98A3D}" target="_blank">great
tool</a> from <a href="http://www.microsoft.com" target="_blank">MSFT Corp</a> Research
in Cambridge that acts as a security diagnosis tool for WSE2 policy files...
</p>
        <p>
Worth trying and looking into even though it is unsupported...Since when is a product
or tool that rolls out from Research supported in the commercial production world
anyways...
</p>
        <p>
Another +1 for Microsoft for the raising awareness in security, esp in the realms
of XML SOAP Services.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ec0da41c-646a-447c-8a7e-818662548199" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>WS-Policy File Advisor in WSE 2.0</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,ec0da41c-646a-447c-8a7e-818662548199.aspx</guid>
      <link>http://www.softwaremaker.net/blog/WSPolicyFileAdvisorInWSE20.aspx</link>
      <pubDate>Fri, 18 Feb 2005 00:43:51 GMT</pubDate>
      <description>&lt;p&gt;
Benjamin &lt;a href="http://benjaminm.net/PermaLink.aspx?guid=662d151b-8c56-48c6-a23a-7372cd3a1fcb" target=_blank&gt;points
to&lt;/a&gt; a &lt;a href="http://research.microsoft.com/research/downloads/download.aspx?FUID={82F07E5E-539B-47ED-A2D2-6F30FFA98A3D}" target=_blank&gt;great
tool&lt;/a&gt; from &lt;a href=http://www.microsoft.com target=_blank&gt;MSFT Corp&lt;/a&gt; Research
in Cambridge that acts as a security diagnosis tool for WSE2 policy files...
&lt;/p&gt;
&lt;p&gt;
Worth trying and looking into even though it is unsupported...Since when is a product
or tool that rolls out from Research supported in the commercial production world
anyways...
&lt;/p&gt;
&lt;p&gt;
Another +1 for Microsoft for the raising&amp;nbsp;awareness in security, esp in the realms
of XML SOAP&amp;nbsp;Services.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=ec0da41c-646a-447c-8a7e-818662548199" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=bc77f7f9-5dba-4565-9c69-65f4208e6be5</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,bc77f7f9-5dba-4565-9c69-65f4208e6be5.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.sda-asia.com" target="_blank">SDA-Asia</a> has recently published
one of my articles <a href="http://www.sda-asia.com/sda/article/psecom,id,9,nodeid,5,_language,Singapore.html" target="_blank">online</a>.
In this article, I talked about how <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> can be used to solve Real-World business problems
with some proper thought and design processes.
</p>
        <p>
This is not as technical an article comparred to the ones I have written
before, however, I feel it gives a good overview and insight to what the advanced XML services
are and how to make use of some of them to solve some of the business problems
of today...and needless to say, WSE 2.0 is <strong><em>THE</em></strong> tool
to do that today in .NET
</p>
        <p>
I have spent a fair amount of time writing up a <em><strong>REAL </strong></em>technical
article (on WSE, of course) recently which I hope will get published soon enough.
Will update all once it goes live. Enjoy.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=bc77f7f9-5dba-4565-9c69-65f4208e6be5" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Online for CXOs: A brief overview of how WSE can be used to solve Real-World business problems</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,bc77f7f9-5dba-4565-9c69-65f4208e6be5.aspx</guid>
      <link>http://www.softwaremaker.net/blog/OnlineForCXOsABriefOverviewOfHowWSECanBeUsedToSolveRealWorldBusinessProblems.aspx</link>
      <pubDate>Sun, 06 Feb 2005 13:00:31 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.sda-asia.com" target=_blank&gt;SDA-Asia&lt;/a&gt; has recently published
one of my articles &lt;a href="http://www.sda-asia.com/sda/article/psecom,id,9,nodeid,5,_language,Singapore.html" target=_blank&gt;online&lt;/a&gt;.
In this article, I talked about how &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; can be used to solve Real-World business problems
with some proper thought and design processes.
&lt;/p&gt;
&lt;p&gt;
This is&amp;nbsp;not as technical an&amp;nbsp;article comparred to the ones I have written
before, however, I feel it gives a good overview and insight to what the advanced&amp;nbsp;XML&amp;nbsp;services
are and how to make use of some of them&amp;nbsp;to solve some of the business problems
of today...and needless to say, WSE 2.0 is&amp;nbsp;&lt;strong&gt;&lt;em&gt;THE&lt;/em&gt;&lt;/strong&gt; tool
to do that today in .NET
&lt;/p&gt;
&lt;p&gt;
I have&amp;nbsp;spent a fair amount of time writing up a&amp;nbsp;&lt;em&gt;&lt;strong&gt;REAL &lt;/strong&gt;&lt;/em&gt;technical
article (on WSE, of course) recently which I hope will get published soon enough.
Will update all once it goes live. Enjoy.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=bc77f7f9-5dba-4565-9c69-65f4208e6be5" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Biz Matters;Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=84298cd8-5bbb-43aa-bb86-6bf4fa9b634d</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,84298cd8-5bbb-43aa-bb86-6bf4fa9b634d.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Finally, <a href="http://www.w3.org/TR/2005/REC-soap12-mtom-20050125/" target="_blank">this</a> is
done. Read the cover story <a href="http://xml.coverpages.org/ni2005-01-25-a.html" target="_blank">here</a>.
</p>
        <p>
Even though I usually dont advocate the use of SOAP to transfer large BLOBS of binary
bits (I tend to think that there are slightly better ways of transferring files and/or
attachments), I do believe that there will be more and more calls for uses for it
and that is why I think this is an important specification which is way better
than <a href="http://www.w3.org/" target="_blank">W3C</a>'s <a href="http://www.w3.org/TR/SOAP-attachments" target="_blank">SwA</a> or <a href="http://www.microsoft.com" target="_blank">MSFT
Corp</a>'s/<a href="http://www.ietf.org" target="_blank">IETF</a>'s  <a href="http://searchwebservices.techtarget.com/sDefinition/0,,sid26_gci921975,00.html" target="_blank">DIME</a> (<strong><em>Can
you say Security ?</em></strong>). The latter, incidentally, is being implemented
by <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 1 and 2.
</p>
        <p>
Of course, since DIME is being superseded by MTOM, I am really looking forward (<em>hopefully</em>)
to the implementations of it in WSE 3.0
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=84298cd8-5bbb-43aa-bb86-6bf4fa9b634d" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>MTOM just got REC status on W3C</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,84298cd8-5bbb-43aa-bb86-6bf4fa9b634d.aspx</guid>
      <link>http://www.softwaremaker.net/blog/MTOMJustGotRECStatusOnW3C.aspx</link>
      <pubDate>Wed, 26 Jan 2005 09:16:26 GMT</pubDate>
      <description>&lt;p&gt;
Finally, &lt;a href="http://www.w3.org/TR/2005/REC-soap12-mtom-20050125/" target=_blank&gt;this&lt;/a&gt; is
done. Read the cover story &lt;a href="http://xml.coverpages.org/ni2005-01-25-a.html" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Even though I usually dont advocate the use of SOAP to transfer large BLOBS of binary
bits (I tend to think that there are slightly better ways of transferring files and/or
attachments), I do believe that there will be more and more calls for uses for it
and that is why I think this is an important specification&amp;nbsp;which is way better
than &lt;a href="http://www.w3.org/" target="_blank"&gt;W3C&lt;/a&gt;'s &lt;a href="http://www.w3.org/TR/SOAP-attachments" target=_blank&gt;SwA&lt;/a&gt; or &lt;a href=http://www.microsoft.com target=_blank&gt;MSFT
Corp&lt;/a&gt;'s/&lt;a href="http://www.ietf.org" target="_blank"&gt;IETF&lt;/a&gt;'s &amp;nbsp;&lt;a href="http://searchwebservices.techtarget.com/sDefinition/0,,sid26_gci921975,00.html" target=_blank&gt;DIME&lt;/a&gt;&amp;nbsp;(&lt;strong&gt;&lt;em&gt;Can
you say Security ?&lt;/em&gt;&lt;/strong&gt;). The latter, incidentally, is being implemented
by &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 1 and 2.
&lt;/p&gt;
&lt;p&gt;
Of course, since DIME is being superseded by MTOM, I am really looking forward (&lt;em&gt;hopefully&lt;/em&gt;)
to the implementations of it in WSE 3.0
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=84298cd8-5bbb-43aa-bb86-6bf4fa9b634d" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Technology;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=0693c01a-8ff3-4fa1-85d7-44bbcf7afa05</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,0693c01a-8ff3-4fa1-85d7-44bbcf7afa05.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
William Stacey has outdone himself again. He has <a href="http://spaces.msn.com/members/staceyw/blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!268.entry?" target="_blank">blogged</a> on
how to create SecurityContextTokens without X509 Certs.
</p>
        <p>
He has beaten me to it. As I have said in a comment to his blog:
</p>
        <p>
          <em>
            <font color="#ff0000">
              <font face="Georgia">...I knew something like that would
be very useful and there are tons of requests out there for the use of SCT without
X.509 because of cost issues or the server admin doesnt want to install them for whatever
reasons.</font>
            </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#ff0000">I was on my way to implementing it, then
I took some time off to look at the specifications for the exchange of entropy values,
then I got derailed by some work committments and after that I just got lost...</font>
          </em>
        </p>
        <p>
          <span class="bvTitle">
            <em>
              <font face="Georgia" color="#ff0000">It is so good for you
to come up with this. It is excellent. I would have to try it and feedback. Many people
will thank you for it.</font>
            </em>
          </span>
        </p>
        <p>
          <span class="bvTitle">
            <a href="http://www.thedatafarm.com/blog" target="_blank">Julie</a>,
if you are reading this, hopefully this will help solve a problem of yours that is
way loooong overdue.</span>
        </p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=0693c01a-8ff3-4fa1-85d7-44bbcf7afa05" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Create SecurityContextTokens without X509 Certs</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,0693c01a-8ff3-4fa1-85d7-44bbcf7afa05.aspx</guid>
      <link>http://www.softwaremaker.net/blog/CreateSecurityContextTokensWithoutX509Certs.aspx</link>
      <pubDate>Tue, 25 Jan 2005 11:26:20 GMT</pubDate>
      <description>&lt;p&gt;
William Stacey has outdone himself again. He has &lt;a href="http://spaces.msn.com/members/staceyw/blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!268.entry?" target=_blank&gt;blogged&lt;/a&gt; on
how to create SecurityContextTokens without X509 Certs.&gt;
&lt;/p&gt;
&lt;p&gt;
He has beaten me to it. As I have said in a comment to his blog:
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font color=#ff0000&gt;&lt;font face=Georgia&gt;...I knew something like that would be
very useful and there are tons of requests out there for the use of SCT without X.509
because of cost issues or the server admin doesnt want to install them for whatever
reasons.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#ff0000&gt;I was on my way to implementing it, then I took
some time off to look at the specifications for the exchange of entropy values, then
I got derailed by some work committments and after that I just got lost...&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span class=bvTitle&gt;&lt;em&gt;&lt;font face=Georgia color=#ff0000&gt;It is so good for you to
come up with this. It is excellent. I would have to try it and feedback. Many people
will thank you for it.&lt;/font&gt;&lt;/em&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span class=bvTitle&gt;&lt;a href="http://www.thedatafarm.com/blog" target=_blank&gt;Julie&lt;/a&gt;,
if you are reading this, hopefully this will help solve a problem of yours that is
way loooong overdue.&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=0693c01a-8ff3-4fa1-85d7-44bbcf7afa05" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=78f77920-5a90-42bf-a9a7-a4bf0dcf9215</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,78f77920-5a90-42bf-a9a7-a4bf0dcf9215.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I recently extended a chat program written in <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 2.0 utililizing the TCP transport protocol. I wanted
it to run over the internet now. This was prompted by some members of our <a href="http://www.sgdotnet.org/" target="_blank">Singapore
Professional DotNet Usergroup</a> who wanted to <a href="http://forums.sgdotnet.org/ShowPost.aspx?PostID=9073" target="_blank">implement</a> a
mini Pub-Sub (aka WS-Eventing) project using the tcp protocol.
</p>
        <p>
They had indicated that they had some trouble binding the FQDN specified for
the URI in the EndpointReference to a local network interface. If this cannot be resolved,
the binding will fail.
</p>
        <p>
At the most basic level, the EndpointReference.Address is both the name of the target
and its location. For example, [http://localhost/SomeService] can be used as a name
and a transport address. WSE 2.0 comes with an extended model to allow a single named
service to be hosted on multiple transport addresses. This can also be useful if we
want to apply a single corporate policy on them.
</p>
        <p>
This is where EndpointReference.Via comes in. It allows you to host a well-known service
that can only be accessible via different transports such as the soap.tcp protocol
of WSE 2.0 and others.
</p>
        <p>
For example, my well-known service is hosted at soap.tcp://softwaremaker.net:2088
(or soap.tcp://219.74.47.214:2088, if you dont have a DNS tagged to it). This
is the public FQDN address of the service. For the broadband cable and ADSL users
of dynamic IPs, this address may be the address of your home network router.
</p>
        <p>
Now, your WSE 2.0 application has a SOAP Receiver object that allows your application
to listen for SOAP requests coming in on WSE2-custom defined transports. Once you define
your own address on your own listening machine such as soap.tcp://192.168.2.100:2088/Softwaremaker,
you would now have 2 URIs:
</p>
        <p>
Public Facing: soap.tcp://softwaremaker.net:2088<br />
Private Internal: soap.tcp://192.168.2.100:2088/Softwaremaker
</p>
        <p>
The Public Facing well-known URI becomes the EndpointReference.Address while the transport
address mechanism becomes the EndpointReference.Via
</p>
        <p>
In other words, soap.tcp://192.168.2.100:2088/Softwaremaker will listen for any messages
that is sent to soap.tcp://softwaremaker.net:2088 (the address element in the WS-Addressing
headers). Put it in another way, the custom soap.tcp transport will only
accept messages sent to soap.tcp://softwaremaker.net:2088 if they arrive via the internal
address:192.168.2.100.
</p>
        <p>
The Via address is not in the message itself, only the well-known URI is. Based on
the network address the message is being received on, the custom soap.tcp transport
mechanism will know how use both well-known and private URIs to dispatch the message
to the registered and configured-properly SOAP Receiver.
</p>
        <p>
          <strong>
            <em>
              <font face="Georgia">    EndpointReference EPR = new
EndpointReference<br />
    (new Address(new Uri("soap.tcp://softwaremaker.net:2088")),</font>
              <br />
    <font face="Georgia">new Via(new Uri(<font face="Verdana">"soap.tcp://192.168.2.100:2088/Softwaremaker"</font>)));</font></em>
          </strong>
        </p>
        <p>
          <font face="Georgia">
            <em>
              <strong>    SoapReceivers.Add(EPR, yourOwnSoapReceiver);</strong>
            </em>
          </font>
        </p>
        <p>
The last step you need to take is to be able to forward all requests going to the
well-known URI (soap.tcp://softwaremaker.net:2088) to your local machine with the
internal IP 192.168.2.100:2088
</p>
        <p>
This is not something you can do in WSE 2.0 or in your machine. This has to be done
at your broadband or cable router. You just have to forward requests coming in to
your Public port:2088 to the Private port:2088 of machine 192.168.2.100 (Note that
these ports doesnt have to be the same number at all)
</p>
        <p>
Of course, the huge assumption is that you have control over the port routing and
forwarding of your broadband or cable router (<em>which may be rather tricky if you
are within a corporate or organizational boundary</em>) BUT technically, you will
be able to carry out a p-2-p SOAP message chat or even do a Pub/Sub model approach
with your own implementation of the “Notification” and “Solicit-Response” message-exchange
patterns over the internet using the custom soap.tcp protocol of WSE 2.0
</p>
        <p>
          <font color="#ff0000">
            <strong>[Author Note] What do ya know ? I just found that that
Hervey has got an even better post on the EndpointReference.Via of WSE 2.0 </strong>
          </font>
          <a href="http://www.dynamic-cast.com/mt-archives/000050.html" target="_blank">here</a>.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=78f77920-5a90-42bf-a9a7-a4bf0dcf9215" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>The wonders of EndpointReference.Via in WSE 2.0</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,78f77920-5a90-42bf-a9a7-a4bf0dcf9215.aspx</guid>
      <link>http://www.softwaremaker.net/blog/TheWondersOfEndpointReferenceViaInWSE20.aspx</link>
      <pubDate>Wed, 19 Jan 2005 01:47:59 GMT</pubDate>
      <description>&lt;p&gt;
I&amp;nbsp;recently extended a chat program written in &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 2.0 utililizing the TCP transport protocol. I wanted
it to run over the internet now. This was prompted by some members of our &lt;a href="http://www.sgdotnet.org/" target=_blank&gt;Singapore
Professional DotNet Usergroup&lt;/a&gt; who wanted to &lt;a href="http://forums.sgdotnet.org/ShowPost.aspx?PostID=9073" target=_blank&gt;implement&lt;/a&gt; a
mini Pub-Sub (aka WS-Eventing)&amp;nbsp;project using the tcp protocol.
&lt;/p&gt;
&lt;p&gt;
They had indicated that they had some trouble binding the&amp;nbsp;FQDN specified for
the URI in the EndpointReference to a local network interface. If this cannot be resolved,
the binding will fail.
&lt;/p&gt;
&lt;p&gt;
At the most basic level, the EndpointReference.Address is both the name of the target
and its location. For example, [http://localhost/SomeService] can be used as a name
and a transport address. WSE 2.0 comes with an extended model to allow a single named
service to be hosted on multiple transport addresses. This can also be useful if we
want to apply a single corporate policy on them.
&lt;/p&gt;
&lt;p&gt;
This is where EndpointReference.Via comes in. It allows you to host a well-known service
that can only be accessible via different transports such as the soap.tcp protocol
of WSE 2.0 and others.
&lt;/p&gt;
&lt;p&gt;
For example, my well-known service is hosted at soap.tcp://softwaremaker.net:2088
(or soap.tcp://219.74.47.214:2088, if you dont have a&amp;nbsp;DNS tagged to it).&amp;nbsp;This
is the public FQDN address of the service. For the broadband cable and ADSL users
of dynamic IPs, this address may be the address of your home network router.
&lt;/p&gt;
&lt;p&gt;
Now, your WSE 2.0 application has a SOAP Receiver object that allows your application
to listen for SOAP requests coming in on WSE2-custom defined transports. Once you&amp;nbsp;define
your own address on your own listening machine such as soap.tcp://192.168.2.100:2088/Softwaremaker,
you would now have 2 URIs:
&lt;/p&gt;
&lt;p&gt;
Public Facing: soap.tcp://softwaremaker.net:2088&lt;br&gt;
Private Internal: soap.tcp://192.168.2.100:2088/Softwaremaker
&lt;/p&gt;
&lt;p&gt;
The Public Facing well-known URI becomes the EndpointReference.Address while the transport
address mechanism becomes the EndpointReference.Via
&lt;/p&gt;
&lt;p&gt;
In other words, soap.tcp://192.168.2.100:2088/Softwaremaker will listen for any messages
that is sent to soap.tcp://softwaremaker.net:2088 (the address element in the WS-Addressing
headers).&amp;nbsp;Put it in&amp;nbsp;another way, the custom soap.tcp transport will only
accept messages sent to soap.tcp://softwaremaker.net:2088 if they arrive via the internal
address:192.168.2.100.
&lt;/p&gt;
&lt;p&gt;
The Via address is not in the message itself, only the well-known URI is. Based on
the network address the message is being received on, the custom soap.tcp transport
mechanism will know how use both well-known and private URIs to dispatch the message
to the registered and configured-properly SOAP Receiver.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;em&gt;&lt;font face=Georgia&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EndpointReference EPR = new
EndpointReference&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(new Address(new Uri("soap.tcp://softwaremaker.net:2088")),&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font face=Georgia&gt;new Via(new Uri(&lt;font face=Verdana&gt;"soap.tcp://192.168.2.100:2088/Softwaremaker"&lt;/font&gt;)));&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Georgia&gt;&lt;em&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SoapReceivers.Add(EPR, yourOwnSoapReceiver);&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
The last step you need to take is to be able to forward all requests going to the
well-known URI (soap.tcp://softwaremaker.net:2088) to your local machine with the
internal IP 192.168.2.100:2088
&lt;/p&gt;
&lt;p&gt;
This is not something you can do in WSE 2.0 or in your machine. This has to be done
at your broadband or cable router. You just have to forward requests coming in to
your Public port:2088 to the Private port:2088 of machine 192.168.2.100 (Note that
these ports doesnt have to be the same number at all)
&lt;/p&gt;
&lt;p&gt;
Of course, the huge assumption is that you have control over the port routing and
forwarding of your broadband or cable router (&lt;em&gt;which may be rather tricky if you
are within a corporate or organizational boundary&lt;/em&gt;) BUT technically, you will
be able to carry&amp;nbsp;out a p-2-p SOAP message chat or even do a Pub/Sub model approach
with your own implementation of the “Notification” and “Solicit-Response” message-exchange
patterns over the internet using the custom soap.tcp protocol of WSE 2.0
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#ff0000&gt;&lt;strong&gt;[Author Note] What do ya know ? I just found that that
Hervey has got an even better post on the EndpointReference.Via of WSE 2.0 &lt;/strong&gt;&lt;/font&gt;&lt;a href="http://www.dynamic-cast.com/mt-archives/000050.html" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=78f77920-5a90-42bf-a9a7-a4bf0dcf9215" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=f97dad7f-362e-41fe-bd5f-0c6906946c69</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,f97dad7f-362e-41fe-bd5f-0c6906946c69.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://spaces.msn.com/members/staceyw/" target="_blank">William Stacy</a> has
a new <a href="http://spaces.msn.com/members/staceyw/PersonalSpace.aspx?_c01_blogpart=blogmgmt&amp;_c=blogpart" target="_blank">blog</a> in
MSN Spaces and he blogged about a topic that has spurned from recent activities in the
WSE newsgroups.
</p>
        <p>
It is about the security and the use of username tokens in the real world, specifically
when it relates to passwords being stored as hash in the user database.
</p>
        <p>
William proposes a method <a href="http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!155.entry" target="_blank">here</a> to
solve the issue of how to authenticate username tokens embedded in _WS-Security Specs_
security headers.
</p>
        <p>
In my own opinion, his case represents a very major common representation of how passwords
are stored in the database. They are mostly and SHOULD be hased. To add another realm
of security, SALT is used. However, I dont really agree that his method may prove
to more secure. In fact, I think it gives a somewhat false sense of security (and
William, please correct me if I am wrong anywhere).
</p>
        <p>
          <strong>1)</strong>   By using your verifier as a matching mechanism to
gain authentication, then this verifier (SALT Hash and all) effectively becomes a
password. If Mallet steals the hash from the user database, nothing prevents him/her
from writing a client that sends the hash and thus he would authenticate successfully.
This is exactly what the hash scheme is trying to avoid in the first place. 
</p>
        <p>
          <em>
            <strong>If used this way, the hash is no safer than storing the passwords in clear
text in the database...which ultimately means that the weakest link is still the security of
the Username Database which must be protected at all costs.</strong>
          </em>
        </p>
        <p>
In other words, this must be made known clearly so that it doesnt preach a false sense
of security that people think that this scheme NOT only protects their
cleartext password BUT also their SOAP calls as well.
</p>
        <p>
This post <a href="http://haacked.com/archive/2004/11/04/1565.aspx" target="_blank">here</a> explains
real well on my thoughts as well.
</p>
        <p>
          <strong>2)</strong>   SALT should be a completely random value and should
be algorithmically introduced to further obfuscate the one-way hash. In your approach,
it seems that the SALT is tied very much to your username (am I wrong ?). This doesnt
help much because I dont need to guess your publicly-available username, there are
only a handful of hashing algorithms out there and you are NOT passing any SALT
into your PasswordDeriveBytes constructor. In fact, the only saving grace is the iteration
count which basically sets the number of iterations for the operation. Is that enough
? I believe it may serve well for some smaller-scale simpler systems BUT I dont know
how it sits well with some of the security policies of bigger enterprises.
</p>
        <p>
IMHO, I think the current username tokens as defined by WS-Security doesnt fit very
well into most EXISTING user databases which store passwords as hashes which may or
may not be SALTED. I dont think there is a clean way to do this in WSE without using
or representing the hashes as passwords. However, I am still thinking about this issue
and will blog more about it later if (not when) I reach enlightenment. <img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif" /></p>
        <p>
Your approach, however, does allow passwords to remain as they are in the EXISTING
user databases. The only obstacle you require is a change in the schema of that table,
which requires management approval and buy-in and usually triggers off many other
related procedures, and that in my experience, is sometimes harder than finding the
password from a hash. <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" /></p>
        <p>
[Author Note]: This topic has got nothing to do with the security of username tokens
as I have blogged about earlier <a href="http://www.softwaremaker.net/blog/PermaLink,guid,20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1.aspx" target="_blank">here</a>.
This is all about the authentication of username tokens with the stored credentials
in the user databases.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=f97dad7f-362e-41fe-bd5f-0c6906946c69" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Further hammering the UsernameTokens, WS-Security Headers, Passwords and Hash issues</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,f97dad7f-362e-41fe-bd5f-0c6906946c69.aspx</guid>
      <link>http://www.softwaremaker.net/blog/FurtherHammeringTheUsernameTokensWSSecurityHeadersPasswordsAndHashIssues.aspx</link>
      <pubDate>Wed, 12 Jan 2005 23:09:54 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://spaces.msn.com/members/staceyw/" target=_blank&gt;William Stacy&lt;/a&gt; has
a new &lt;a href="http://spaces.msn.com/members/staceyw/PersonalSpace.aspx?_c01_blogpart=blogmgmt&amp;amp;_c=blogpart" target=_blank&gt;blog&lt;/a&gt; in
MSN Spaces and he blogged about a topic that has spurned from recent activities&amp;nbsp;in&amp;nbsp;the
WSE newsgroups.
&lt;/p&gt;
&lt;p&gt;
It is about the security and the use of username tokens in the real world, specifically
when it relates to passwords being stored as hash in the user database.
&lt;/p&gt;
&lt;p&gt;
William proposes a method &lt;a href="http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!155.entry" target=_blank&gt;here&lt;/a&gt; to
solve the issue of how to authenticate username tokens embedded in _WS-Security Specs_
security headers.
&lt;/p&gt;
&lt;p&gt;
In my own opinion, his case represents a very major common representation of how passwords
are stored in the database. They are mostly and SHOULD be hased. To add another realm
of security, SALT is used. However, I dont really agree that his method may prove
to more secure. In fact, I think it gives a somewhat false sense of security (and
William, please correct me if I am wrong anywhere).
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;1)&lt;/strong&gt;&amp;nbsp;&amp;nbsp; By using your verifier as a matching mechanism to
gain authentication, then this verifier (SALT Hash and all) effectively becomes a
password. If Mallet steals the hash from the user database, nothing prevents him/her
from writing a client that sends the hash and thus he would authenticate successfully.
This is exactly what the hash scheme is trying to avoid in the first place. 
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;strong&gt;If used this way, the hash is no safer than storing the passwords in clear
text in the database...which ultimately means that the weakest link is still the security&amp;nbsp;of
the Username Database which must be protected at all costs.&lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
In other words, this must be made known clearly so that it doesnt preach a false sense
of security&amp;nbsp;that&amp;nbsp;people&amp;nbsp;think that this scheme NOT only protects their
cleartext password BUT also their SOAP calls as well.
&lt;/p&gt;
&lt;p&gt;
This post &lt;a href="http://haacked.com/archive/2004/11/04/1565.aspx" target=_blank&gt;here&lt;/a&gt; explains
real well on my thoughts as well.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;2)&lt;/strong&gt;&amp;nbsp;&amp;nbsp; SALT should be a completely random value and should
be algorithmically introduced to further obfuscate the one-way hash. In your approach,
it seems that the SALT is tied very much to your username (am I wrong ?). This doesnt
help much because I dont need to guess your publicly-available username, there are
only a handful of hashing algorithms out there and you are NOT&amp;nbsp;passing any SALT
into your PasswordDeriveBytes constructor. In fact, the only saving grace is the iteration
count which basically sets the number of iterations for the operation. Is that enough
? I believe it may serve well for some smaller-scale simpler systems BUT I dont know
how it sits well with some of the security policies of bigger enterprises.
&lt;/p&gt;
&lt;p&gt;
IMHO, I think the current username tokens as defined by WS-Security doesnt fit very
well into most EXISTING user databases which store passwords as hashes which may or
may not be SALTED. I dont think there is a clean way to do this in WSE without using
or representing the hashes as passwords. However, I am still thinking about this issue
and will blog more about it later if (not when) I reach enlightenment. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif"&gt;
&lt;/p&gt;
&lt;p&gt;
Your approach, however, does allow passwords to remain as they are in the EXISTING
user databases. The only obstacle you require is a change in the schema of that table,
which requires management approval and buy-in and usually triggers off many other
related procedures, and that in my experience, is sometimes harder than finding the
password from a hash. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;
&lt;/p&gt;
&lt;p&gt;
[Author Note]: This topic has got nothing to do with the security of username tokens
as I have blogged about earlier &lt;a href="http://www.softwaremaker.net/blog/PermaLink,guid,20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1.aspx" target=_blank&gt;here&lt;/a&gt;.
This is all about the authentication of username tokens with the stored credentials
in the user databases.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=f97dad7f-362e-41fe-bd5f-0c6906946c69" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=7244d041-5f52-48f2-98a2-a6cb00a5ad7e</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,7244d041-5f52-48f2-98a2-a6cb00a5ad7e.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After installing <a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements">Web
Services Enhancements (WSE)</a> 2.0 SP2, the most natural thing for me to do is to
run my previous WSE 2.0 SP1 projects and see if it works with the new assembly.
</p>
        <p>
Most of it still do run &lt;phew&gt;. A couple of them (specifically the SOAP Routing
ones) did NOT run as intended. A further drilldown into the code revealed that the
ExtendedSecurity doesnt serialize properly if you are planning to send another set
of Security Headers to the next SOAP node...In fact, it doesnt get serialized
at all.
</p>
        <p>
...Obviously, this next node cannot be the ultimate soap receiver as target service
cannot process 2 security headers as specified in the _WS-Security Specs_. You can
refer to my previous discussions with <a href="http://www.dynamic-cast.com/" target="_blank">HerveyW</a><a href="http://www.dynamic-cast.com/mt-archives/000069.html" target="_blank">here</a> and <a href="http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx" target="_blank">here</a>.
</p>
        <p>
So, if your next node is another SOAP Router and you need a different set of Security
Headers for the next node to process, this is how to do it with the ExtendedSecurity
function in SP2:
</p>
        <p>
You need to add a Security Utility Timestamp into the Security Header in order for
the ExtendedSecurity function to serialize a new set of Security Headers properly.
</p>
        <p>
          <font face="Georgia" color="#ff0000">
            <strong>Dim t As Utility.Timestamp = AnotherSecurityHeaderBlock.Timestamp</strong>
          </font>
        </p>
        <p>
Thereafter, when you call the ExtendedSecurity function and add this new Security
Header block, the serialization will take place.
</p>
        <p>
In SP1, it is NOT necessarily for you to add this timestamp.
</p>
        <p>
The WSE team has confirmed this as a workaround to this minor bug.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=7244d041-5f52-48f2-98a2-a6cb00a5ad7e" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Little bug in WSE 2.0 SP2</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,7244d041-5f52-48f2-98a2-a6cb00a5ad7e.aspx</guid>
      <link>http://www.softwaremaker.net/blog/LittleBugInWSE20SP2.aspx</link>
      <pubDate>Wed, 12 Jan 2005 10:38:07 GMT</pubDate>
      <description>&lt;p&gt;
After installing &lt;a href="http://msdn2.microsoft.com/en-us/webservices/aa740663.aspx" target="_blank" title="Web Services Enchancements"&gt;Web
Services Enhancements (WSE)&lt;/a&gt; 2.0 SP2, the most natural thing for me to do is to
run&amp;nbsp;my previous WSE 2.0 SP1 projects and see if it works with the new assembly.
&lt;/p&gt;
&lt;p&gt;
Most of it still do run &amp;lt;phew&amp;gt;. A couple of them (specifically the SOAP Routing
ones) did NOT run as intended. A further drilldown into the code revealed that the
ExtendedSecurity doesnt serialize properly if you are planning to send another set
of Security Headers to the next SOAP&amp;nbsp;node...In fact, it doesnt get serialized
at all.
&lt;/p&gt;
&lt;p&gt;
...Obviously, this next node cannot be the ultimate soap receiver as target service
cannot process 2 security headers as specified in the _WS-Security Specs_. You can
refer to my previous discussions with &lt;a href="http://www.dynamic-cast.com/" target=_blank&gt;HerveyW&lt;/a&gt; &lt;a href="http://www.dynamic-cast.com/mt-archives/000069.html" target=_blank&gt;here&lt;/a&gt; and &lt;a href="http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
So, if your next node is another SOAP Router and you need a different set of Security
Headers for&amp;nbsp;the next node&amp;nbsp;to process, this is how to do it with the ExtendedSecurity
function in SP2:
&lt;/p&gt;
&lt;p&gt;
You need to add a Security Utility Timestamp into the Security Header in order for
the ExtendedSecurity function to serialize a new set of Security Headers properly.
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Georgia color=#ff0000&gt;&lt;strong&gt;Dim t As Utility.Timestamp = AnotherSecurityHeaderBlock.Timestamp&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Thereafter, when you call the ExtendedSecurity function and add this new Security
Header block, the serialization will take place.
&lt;/p&gt;
&lt;p&gt;
In SP1, it is NOT necessarily for you to add this timestamp.
&lt;/p&gt;
&lt;p&gt;
The&amp;nbsp;WSE team has confirmed this as a workaround to this minor bug.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=7244d041-5f52-48f2-98a2-a6cb00a5ad7e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=45822828-5b63-4cb6-b139-97bd1ab03ec4</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,45822828-5b63-4cb6-b139-97bd1ab03ec4.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
With reference to my earlier post <a href="http://www.softwaremaker.net/blog/PermaLink,guid,43d85031-3e0b-48a7-bdd7-1f49932db40a.aspx" target="_blank">here</a>,
I had explained how we can encrypt the Usernametoken element &lt;wsse:UsernameToken&gt;
if we choose to use the PasswordOption.SendPlainText enumeration, for real-world reasons
such as
</p>
        <ul>
          <li>
Windows Authentication 
</li>
          <li>
Passwords are stored as Hash in the UserDB</li>
        </ul>
        <p>
Other elements in the &lt;wsse:Security&gt; Header element can be encrypted too, although
great care and design must be taken as it may reduce the extensibility of SOAP Headers
through routing intermediaries. One of them is the &lt;Signature&gt; element.
</p>
        <p>
As I had explained in another post <a href="http://www.softwaremaker.net/blog/CommentView,guid,371862d9-5622-4bc7-a6d6-5581b9eea12e.aspx" target="_blank">here</a>,
digital signatures <strong><em>can</em></strong> and <strong><em>may</em></strong> be
verified for authentication and trust by any SOAP node. If the &lt;Signature&gt; element
is encrypted, we may be preventing any SOAP intermediary from authenticating and verifying
the digital signature. Unlike digital signatures, &lt;xenc:EncryptedData&gt; elements
are encrypted for a specific receiver in mind and therefore, only that one party <strong><em>SHOULD</em></strong> be
able to decipher it with a corresponding Private key or shared secret. SOAP intermediaries,
trusted or not, <strong><em>SHOULD NOT</em></strong> be able to decrypt or view
the the encrypted content(s) and therefore cannot authenticate and verify the signature.
</p>
        <p>
However, if one should decide that their dispatching mechanism is based on a non-intermediary
route or if the &lt;Signature&gt; element may not be meant for the ultimate SOAP
receiver and therefore can be removed by the SOAP intermediary, this can
be done easily as well with WSE 2.0.
</p>
        <p>
The key is to create a MessageSignature on its own and assign it an ID. Here is the
code snippet on how to implement it:<span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><hr id="null" />
Dim</span> a <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> MessageSignature(yourSignatureToken)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> g <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> Guid <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> g.NewGuid<br />
a.Signature.Id <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> g.ToString<br /><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'...</span><br /><br />
Context.Tokens.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(yourSignatureToken)<br />
Context.Tokens.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(yourEncryptionToken)<br />
Context.Elements.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(a)<br />
Context.Elements.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> EncryptedData(yourEncryptionToken, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"#"</span> &amp;
a.Signature.Id)) 
<hr id="null" /></span></p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">And
the wonderful result that comes out from the oven: (geez...I need a life <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" />)
</font>
          </span>
        </p>
        <p>
          <hr id="null" />
        </p>
        <p>
        </p>
        <p>
&lt;wsse:Security soap:mustUnderstand="1"&gt;<br />
&lt;wsse:BinarySecurityToken ValueType="<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</a>"
EncodingType="<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary</a>"
wsu:Id="SecurityToken-e8f64eea-1d63-4db2-943c-9bfb5dfccbfc"&gt;MIIBxDC...du2fPMER8ajJfl&lt;/wsse:BinarySecurityToken&gt; 
<br />
&lt;wsse:UsernameToken wsu:Id="SecurityToken-3370d9ae-deb9-4a01-9b9c-c8dd072568fa"&gt;<br />
&lt;wsse:Username&gt;ABC&lt;/wsse:Username&gt; 
<br />
&lt;wsse:Nonce&gt;Amx9amrLXR02etJLsNwdwA==&lt;/wsse:Nonce&gt; 
<br />
&lt;wsu:Created&gt;2004-12-11T07:38:33Z&lt;/wsu:Created&gt; 
<br />
&lt;/wsse:UsernameToken&gt;<br />
&lt;xenc:ReferenceList xmlns:xenc="<a href="http://www.w3.org/2001/04/xmlenc">http://www.w3.org/2001/04/xmlenc</a>#"&gt;<br />
&lt;xenc:DataReference URI="#EncryptedContent-0e6936bf-67a5-48a5-ba8a-d9ba6141e75f"
/&gt; 
<br />
&lt;/xenc:ReferenceList&gt;<br /><strong><font color="#ff0000">&lt;Signature Id="2c091bb3-bcdc-4da1-97c5-dcd60dac7312"
xmlns="</font></strong><a href="http://www.w3.org/2000/09/xmldsig"><strong><font color="#ff0000">http://www.w3.org/2000/09/xmldsig</font></strong></a><strong><font color="#ff0000">#"&gt;<br />
&lt;xenc:EncryptedData Id="EncryptedContent-0e6936bf-67a5-48a5-ba8a-d9ba6141e75f"
Type="</font></strong><a href="http://www.w3.org/2001/04/xmlenc#Content"><strong><font color="#ff0000">http://www.w3.org/2001/04/xmlenc#Content</font></strong></a><strong><font color="#ff0000">"
xmlns:xenc="</font></strong><a href="http://www.w3.org/2001/04/xmlenc"><strong><font color="#ff0000">http://www.w3.org/2001/04/xmlenc</font></strong></a><strong><font color="#ff0000">#"&gt;<br />
&lt;xenc:EncryptionMethod Algorithm="</font></strong><a href="http://www.w3.org/2001/04/xmlenc#aes128-cbc"><strong><font color="#ff0000">http://www.w3.org/2001/04/xmlenc#aes128-cbc</font></strong></a><strong><font color="#ff0000">"
/&gt; 
<br />
&lt;KeyInfo xmlns="</font></strong><a href="http://www.w3.org/2000/09/xmldsig"><strong><font color="#ff0000">http://www.w3.org/2000/09/xmldsig</font></strong></a><strong><font color="#ff0000">#"&gt;<br />
&lt;wsse:SecurityTokenReference&gt;<br />
&lt;wsse:Reference URI="#SecurityToken-3370d9ae-deb9-4a01-9b9c-c8dd072568fa" ValueType="</font></strong><a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"><strong><font color="#ff0000">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</font></strong></a><strong><font color="#ff0000">"
/&gt; 
<br />
&lt;/wsse:SecurityTokenReference&gt;<br />
&lt;/KeyInfo&gt;<br />
&lt;xenc:CipherData&gt;  &lt;xenc:CipherValue&gt;rFfJS87yAdFFkW1dVbot...tJ+9U8+CU5qsI=&lt;/xenc:CipherValue&gt; 
<br />
&lt;/xenc:CipherData&gt;<br />
&lt;/xenc:EncryptedData&gt;<br />
&lt;/Signature&gt;</font><br /></strong>&lt;/wsse:Security&gt; 
<hr id="null" /></p>
        <p>
        </p>
        <p>
Voila! The Red bold font will show that the Signature Element is now encrypted.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=45822828-5b63-4cb6-b139-97bd1ab03ec4" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Encrypting the Signature Element in the &lt;wsse:Security&gt; Header element</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,45822828-5b63-4cb6-b139-97bd1ab03ec4.aspx</guid>
      <link>http://www.softwaremaker.net/blog/EncryptingTheSignatureElementInTheHeaderElement.aspx</link>
      <pubDate>Sat, 11 Dec 2004 08:14:03 GMT</pubDate>
      <description>&lt;p&gt;
With reference to my earlier post &lt;a href="http://www.softwaremaker.net/blog/PermaLink,guid,43d85031-3e0b-48a7-bdd7-1f49932db40a.aspx" target=_blank&gt;here&lt;/a&gt;,
I had explained how we can encrypt the Usernametoken element &amp;lt;wsse:UsernameToken&amp;gt;
if we choose to use the PasswordOption.SendPlainText enumeration, for real-world reasons
such as
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Windows Authentication 
&lt;li&gt;
Passwords are stored as Hash in the UserDB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Other elements in the &amp;lt;wsse:Security&amp;gt; Header element can be encrypted too, although
great care and design must be taken as it may reduce the extensibility of SOAP Headers
through routing intermediaries. One of them is the &amp;lt;Signature&amp;gt; element.
&lt;/p&gt;
&lt;p&gt;
As I had explained in another post &lt;a href="http://www.softwaremaker.net/blog/CommentView,guid,371862d9-5622-4bc7-a6d6-5581b9eea12e.aspx" target=_blank&gt;here&lt;/a&gt;,
digital signatures &lt;strong&gt;&lt;em&gt;can&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;may&lt;/em&gt;&lt;/strong&gt; be
verified for authentication and trust by any SOAP node. If the &amp;lt;Signature&amp;gt; element
is encrypted, we may be preventing any SOAP intermediary from authenticating and verifying
the digital signature. Unlike digital signatures, &amp;lt;xenc:EncryptedData&amp;gt; elements
are encrypted&amp;nbsp;for a specific receiver in mind and therefore, only that one party &lt;strong&gt;&lt;em&gt;SHOULD&lt;/em&gt;&lt;/strong&gt; be
able to decipher it with a corresponding Private key or shared secret. SOAP intermediaries,
trusted or not, &lt;strong&gt;&lt;em&gt;SHOULD NOT&lt;/em&gt;&lt;/strong&gt; be able to decrypt&amp;nbsp;or view
the the encrypted content(s) and therefore cannot authenticate and verify the signature.
&lt;/p&gt;
&lt;p&gt;
However, if one should decide that their dispatching mechanism is based on a non-intermediary
route or if the &amp;lt;Signature&amp;gt; element&amp;nbsp;may not be meant for the ultimate SOAP
receiver and therefore can&amp;nbsp;be removed&amp;nbsp;by the SOAP intermediary, this can
be done easily as well with WSE 2.0.
&lt;/p&gt;
&lt;p&gt;
The key is to create a MessageSignature on its own and assign it an ID. Here is the
code snippet on how to implement it:&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;hr id=null&gt;
Dim&lt;/span&gt; a &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; MessageSignature(yourSignatureToken)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; g &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; Guid &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; g.NewGuid&lt;br&gt;
a.Signature.Id &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; g.ToString&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'...&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
Context.Tokens.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(yourSignatureToken)&lt;br&gt;
Context.Tokens.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(yourEncryptionToken)&lt;br&gt;
Context.Elements.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(a)&lt;br&gt;
Context.Elements.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; EncryptedData(yourEncryptionToken, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"#"&lt;/span&gt; &amp;amp;
a.Signature.Id)) 
&lt;hr id=null&gt;
&lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;And
the wonderful result that comes out from the oven: (geez...I need a life &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;)
&lt;/p&gt;
&lt;p&gt;
&lt;hr id=null&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;lt;wsse:Security soap:mustUnderstand="1"&amp;gt;&lt;br&gt;
&amp;lt;wsse:BinarySecurityToken ValueType="&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&lt;/a&gt;"
EncodingType="&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&lt;/a&gt;"
wsu:Id="SecurityToken-e8f64eea-1d63-4db2-943c-9bfb5dfccbfc"&amp;gt;MIIBxDC...du2fPMER8ajJfl&amp;lt;/wsse:BinarySecurityToken&amp;gt; 
&lt;br&gt;
&amp;lt;wsse:UsernameToken wsu:Id="SecurityToken-3370d9ae-deb9-4a01-9b9c-c8dd072568fa"&amp;gt;&lt;br&gt;
&amp;lt;wsse:Username&amp;gt;ABC&amp;lt;/wsse:Username&amp;gt; 
&lt;br&gt;
&amp;lt;wsse:Nonce&amp;gt;Amx9amrLXR02etJLsNwdwA==&amp;lt;/wsse:Nonce&amp;gt; 
&lt;br&gt;
&amp;lt;wsu:Created&amp;gt;2004-12-11T07:38:33Z&amp;lt;/wsu:Created&amp;gt; 
&lt;br&gt;
&amp;lt;/wsse:UsernameToken&amp;gt;&lt;br&gt;
&amp;lt;xenc:ReferenceList xmlns:xenc="&lt;a href="http://www.w3.org/2001/04/xmlenc"&gt;http://www.w3.org/2001/04/xmlenc&lt;/a&gt;#"&amp;gt;&lt;br&gt;
&amp;lt;xenc:DataReference URI="#EncryptedContent-0e6936bf-67a5-48a5-ba8a-d9ba6141e75f"
/&amp;gt; 
&lt;br&gt;
&amp;lt;/xenc:ReferenceList&amp;gt;&lt;br&gt;
&lt;strong&gt;&lt;font color=#ff0000&gt;&amp;lt;Signature Id="2c091bb3-bcdc-4da1-97c5-dcd60dac7312"
xmlns="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://www.w3.org/2000/09/xmldsig&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;#"&amp;gt;&lt;br&gt;
&amp;lt;xenc:EncryptedData Id="EncryptedContent-0e6936bf-67a5-48a5-ba8a-d9ba6141e75f"
Type="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://www.w3.org/2001/04/xmlenc#Content"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://www.w3.org/2001/04/xmlenc#Content&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;"
xmlns:xenc="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://www.w3.org/2001/04/xmlenc"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://www.w3.org/2001/04/xmlenc&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;#"&amp;gt;&lt;br&gt;
&amp;lt;xenc:EncryptionMethod Algorithm="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://www.w3.org/2001/04/xmlenc#aes128-cbc"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://www.w3.org/2001/04/xmlenc#aes128-cbc&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;lt;KeyInfo xmlns="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://www.w3.org/2000/09/xmldsig&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;#"&amp;gt;&lt;br&gt;
&amp;lt;wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;lt;wsse:Reference URI="#SecurityToken-3370d9ae-deb9-4a01-9b9c-c8dd072568fa" ValueType="&lt;/font&gt;&lt;/strong&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken"&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;lt;/wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;lt;/KeyInfo&amp;gt;&lt;br&gt;
&amp;lt;xenc:CipherData&amp;gt;&amp;nbsp; &amp;lt;xenc:CipherValue&amp;gt;rFfJS87yAdFFkW1dVbot...tJ+9U8+CU5qsI=&amp;lt;/xenc:CipherValue&amp;gt; 
&lt;br&gt;
&amp;lt;/xenc:CipherData&amp;gt;&lt;br&gt;
&amp;lt;/xenc:EncryptedData&amp;gt;&lt;br&gt;
&amp;lt;/Signature&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;/strong&gt;&amp;lt;/wsse:Security&amp;gt; 
&lt;hr id=null&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Voila! The Red bold font will show that the Signature Element is now encrypted.&gt;&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=45822828-5b63-4cb6-b139-97bd1ab03ec4" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=d6a2bd5f-310f-4697-9d8c-8f53b6caeb03</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,d6a2bd5f-310f-4697-9d8c-8f53b6caeb03.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
To slightly expand on my <a href="http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx" target="_blank">post</a> and <a href="http://www.dynamic-cast.com/mt-archives/000069.html" target="_blank">Hervey's</a> a
little bit further, there was mention on the use of Enveloped Signatures in the SOAP
Headers. Enveloped Signature (as defined by <a href="http://www.w3.org/TR/xmldsig-core/" target="_blank">XML-Digital
Signature</a>) is a signature over the XML content that contains the
signature as an element. The content provides the root XML document element. Obviously,
enveloped signatures must take care not to include their own value in the calculation
of the SignatureValue. In other words, Enveloped Signature would sign the contents
of the SOAP headers <strong><em>WITHOUT</em></strong> the signature. This is
the only way a Security header can be signed without creating a circular reference
dependency.
</p>
        <p>
To do the above, you are enforcing the prevention of intermediaries from modifying
the SOAP Headers.
</p>
        <p>
However, as taken from the _WS-Security Specs_ 
<hr id="null" /><em><font face="Georgia" color="#ff0000">Because of the mutability of some SOAP headers,
producers SHOULD NOT use the Enveloped Signature Transform defined in XML Signature.
Instead, messages SHOULD explicitly include the elements to be signed. Similarly,
producers SHOULD NOT use the Enveloping Signature defined in XML Signature [XMLSIG]</font></em><hr id="null" /></p>
        <p>
        </p>
        <p>
WS-Security doesnt *believe* in the Enveloped Signatures because it stands on the belief
that SOAP Headers are <a href="http://www.hyperdictionary.com/dictionary/mutable" target="_blank">mutable</a>.
Since SOAP Headers can change and the likelihood is there that a SOAP intermediary
can change the headers, an Enveloped Signature would not be as extensible and work
as well.
</p>
        <p>
I am a strong believer of that. If a normal signature is used instead of an enveloped one,
then an intermediary can safely add more tokens and more signatures to a Security
header targeted at another node on the message path...and that is why there is WS-Security.
Security cannot just be based on End-to-End scenarios or else SSL / HTTPS will
suffice.
</p>
        <p>
I also further believe that an intermediary should be able to extend Security headers
which are meant for other target nodes. Since a SOAP node can only process a
single Security Header (because of re-ordering constraints of SOAP Headers), this
option may not be as far-fetched or ridiculous as it may sound.
</p>
        <p>
Of course, anyone can still choose to implement Enveloped Signatures over their SOAP
Headers if they are just implementing End-to-End scenarios and enforcing non-tampering
measures over any desired or <em>un-desired</em> intermediaries. However, extensibility may
not be an option here should intermediaries be required to offload certain processing
functionality off the ultimate receiver or even add more tokens and signatures along
the way.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=d6a2bd5f-310f-4697-9d8c-8f53b6caeb03" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Enveloped Signatures - XMLDSIG and WS-Security</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,d6a2bd5f-310f-4697-9d8c-8f53b6caeb03.aspx</guid>
      <link>http://www.softwaremaker.net/blog/EnvelopedSignaturesXMLDSIGAndWSSecurity.aspx</link>
      <pubDate>Sat, 11 Dec 2004 02:57:32 GMT</pubDate>
      <description>&lt;p&gt;
To slightly expand on&amp;nbsp;my &lt;a href="http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx" target=_blank&gt;post&lt;/a&gt; and &lt;a href="http://www.dynamic-cast.com/mt-archives/000069.html" target=_blank&gt;Hervey's&lt;/a&gt; a
little bit further, there was mention on the use of Enveloped Signatures in the SOAP
Headers. Enveloped Signature&amp;nbsp;(as defined by &lt;a href="http://www.w3.org/TR/xmldsig-core/" target="_blank"&gt;XML-Digital
Signature&lt;/a&gt;)&amp;nbsp;is a&amp;nbsp;signature&amp;nbsp;over the XML content that contains the
signature as an element. The content provides the root XML document element. Obviously,
enveloped signatures must take care not to include their own value in the calculation
of the SignatureValue. In other words, Enveloped Signature would sign the contents
of the SOAP headers&amp;nbsp;&lt;strong&gt;&lt;em&gt;WITHOUT&lt;/em&gt;&lt;/strong&gt; the signature. This is
the only way a Security header can be signed without creating a circular reference
dependency.
&lt;/p&gt;
&lt;p&gt;
To do the above, you are enforcing the prevention of&amp;nbsp;intermediaries from modifying
the SOAP Headers.
&lt;/p&gt;
&lt;p&gt;
However, as taken from the _WS-Security Specs_ 
&lt;hr id=null&gt;
&lt;em&gt;&lt;font face=Georgia color=#ff0000&gt;Because of the mutability of some SOAP headers,
producers SHOULD NOT use the Enveloped Signature Transform defined in XML Signature.
Instead, messages SHOULD explicitly include the elements to be signed. Similarly,
producers SHOULD NOT use the Enveloping Signature defined in XML Signature [XMLSIG]&lt;/font&gt;&lt;/em&gt; 
&lt;hr id=null&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
WS-Security doesnt *believe* in the Enveloped Signatures because it stands on the&amp;nbsp;belief
that SOAP Headers are &lt;a href="http://www.hyperdictionary.com/dictionary/mutable" target=_blank&gt;mutable&lt;/a&gt;.
Since SOAP Headers can change and the likelihood is there that a SOAP intermediary
can change the headers, an Enveloped Signature would not be as extensible and work
as well.
&lt;/p&gt;
&lt;p&gt;
I am a strong believer of that. If a normal signature is used instead of an&amp;nbsp;enveloped&amp;nbsp;one,
then an intermediary can safely add more tokens and more signatures to a Security
header targeted at another node on the message path...and that is why there is WS-Security.
Security cannot just be based on End-to-End scenarios or else SSL / HTTPS&amp;nbsp;will
suffice.
&lt;/p&gt;
&lt;p&gt;
I also further believe that an intermediary should be able to extend Security headers
which&amp;nbsp;are meant for other target nodes. Since a SOAP node can only process a
single Security Header (because of re-ordering constraints of SOAP Headers), this
option may not be as far-fetched or ridiculous as it may sound.
&lt;/p&gt;
&lt;p&gt;
Of course, anyone can still choose to implement Enveloped Signatures over their SOAP
Headers if they are just implementing End-to-End scenarios and enforcing non-tampering
measures over any desired or &lt;em&gt;un-desired&lt;/em&gt; intermediaries. However, extensibility&amp;nbsp;may
not be an option here should intermediaries be required to offload certain processing
functionality off the ultimate receiver or even add more tokens and signatures along
the way.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=d6a2bd5f-310f-4697-9d8c-8f53b6caeb03" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Software Architectures;Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have been noticing an increasing number of emails and newgroup threads asking for
the security of Usernametokens as specified by _WS-Security Specs_ on <a href="http://www.oasis-open.org" target="_blank">OASIS</a>.
Most people would like to use it because it is the only alternative they have and
there are no other options for using <a href="http://www.ietf.org/html.charters/pkix-charter.html" target="_blank">X.509
PKI Digital Certificates</a>. Here is my personal take on it.
</p>
        <p>
I think some of the security concerns are slightly misplaced here. Firstly, I dont
think <a href="http://www.ws-i.org" target="_blank" title="Web Services Interoperability Organization">WS-I</a> or
OASIS would include Usernametokens inside the WS-Security Specifications if they doubt
its security. As I would like to say, --- <strong>Implementation is key</strong>.
</p>
        <p>
A Username token does <strong><em>NOT</em></strong> use any simpler or less-standard
security algorithm than any other tokens. In fact, it uses the same hashing algorithm,
symmetric algorithm such as the 128-key Cipher Block Chain (cbc) <a href="http://www.cescomm.co.nz/about/aes.html" target="_blank">Advanced
Encryption Standard</a>, etc as any other token. Many people, also, do not realize
that the same symmetric algorithm is used to encrypt the SOAP message body when an asymmetric
X509SecurityToken is used as well. The asymmetric key algorithm is only used
to encrypt the secret key that is doing the actual symmetric encryption processing.
This is done for the purpose of reducing cipher bloat and increasing processing speed.
The paranoia in me, however, would go for a higher-bit key implementation, which
is possible.
</p>
        <p>
Remember that your secret can be stolen and kept for years and tried to be broken
with much higher-end and cheaper deciphering machines in the future. OK, OK, that
is my paraniod self talking. <img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif" /></p>
        <p>
I believe when statements are made against the security of Usernametokens, they are
made against the passwords of the Usernametokens. Therefore, the statement: "Usernametokens,
on their own they are only as secure as the passwords"
</p>
        <p>
Usernametokens are as secure as your passwords. That means that if you have a good
security policy on how your company treats passwords, ie...
</p>
        <ol>
          <li>
Minimum password length 
</li>
          <li>
Implementation of alphanumeric and other different characters and symbols in password 
</li>
          <li>
Password change frequency (in months instead of years <img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif" />) 
</li>
          <li>
Elimination of Weak Passwords such as using names and such 
</li>
          <li>
...</li>
        </ol>
        <p>
you should <strong><em>NOT</em></strong> be so fearful of using a Usernametoken
in your Web Service implementation.
</p>
        <p>
On the other hand, if you don't treat or administer your passwords with good password
policies, then you cannot expect Usernametokens to give your message as secure a protection
as you would like.
</p>
        <p>
I would also recommend using the PasswordOption.SendNone, if possible. The hash of
the password and other elements are used to produce the cipher. NO password is
sent over using this enumerated option. Of course, the only caveat is except through
a dictionary attack, which of course, can be made so much more difficult
(or almost impossible) by having a good password policy administration system.
</p>
        <p>
If you have to send your Usernametoken over in PasswordOption.SendPlainText for whatever
reasons (using Windows, LDAP Authentication or you may have hashed versions of your
passwords stored in your UserDB), you <strong><em>SHOULD</em></strong> encrypt
the UsernameToken with a X.509 digital certificate. Read my post <a href="http://www.softwaremaker.net/blog/PermaLink,guid,43d85031-3e0b-48a7-bdd7-1f49932db40a.aspx" target="_blank">here</a> for
my own implementation of it.
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
Another thing to take note is one that relates to the real world and why I believe
Usernametokens have its place here. It is easiest to implement and common in any business
environments. Therefore, it can be plugged into any existing IT systems with relatively
lesser effort. Also, X509 digital certs are usually used to authenticate machines
and / or companies, it would be more expensive and unrealistic to expect every user
in a 100+ user organization to have a digital cert and a private / public key
pair. Therefore, I strongly believe that Usernametokens are more appt to authenticate
the users <strong><em>themselves</em></strong> in the real world and will continue
to be one of the most popular way to authenticate users in the near <em>biometric-less</em> future.
However, if you are using authentication between machines, you <strong><em>should</em></strong> opt
for X509 digital certs instead.
</p>
        <p>
          <hr id="null" />
          <font color="#ff0000">
            <font face="Georgia">[Author note] I believe WSE 2.0 SP2 has
taken some lengths to make sure that Usernametokens which transmits a clear text password
are now encrypted.</font>
          </font>
        </p>
        <p>
        </p>
        <p>
          <font color="#ff0000">
          </font>
        </p>
        <ul>
          <li>
            <font face="Georgia" color="#ff0000">For security reasons, it is strongly recommended
to encrypt Username tokens, especially when they contain password information. The <b>SecurityTokenServiceClient</b> class
now automatically encrypts any <b>UsernameToken</b> security tokens included in outgoing
SOAP requests. Similarly, the <b>SecurityTokenService</b> class automatically encrypts
any <b>UsernameToken</b> security tokens included in outgoing SOAP responses.</font>
          </li>
        </ul>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Security of UsernameTokens in WS-Security as implemented by WSE 2.0</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1.aspx</guid>
      <link>http://www.softwaremaker.net/blog/SecurityOfUsernameTokensInWSSecurityAsImplementedByWSE20.aspx</link>
      <pubDate>Thu, 09 Dec 2004 01:57:26 GMT</pubDate>
      <description>&lt;p&gt;
I have been noticing an increasing number of emails and newgroup threads asking for
the security of Usernametokens as specified by _WS-Security Specs_ on &lt;a href="http://www.oasis-open.org" target="_blank"&gt;OASIS&lt;/a&gt;.
Most people would like to use it because it is the only alternative they have and
there are no other options for using &lt;a href="http://www.ietf.org/html.charters/pkix-charter.html" target="_blank"&gt;X.509
PKI Digital Certificates&lt;/a&gt;. Here is my personal take on it.
&lt;/p&gt;
&lt;p&gt;
I think some of the security concerns are slightly misplaced here. Firstly, I dont
think &lt;a href="http://www.ws-i.org" target="_blank" title="Web Services Interoperability Organization"&gt;WS-I&lt;/a&gt; or
OASIS would include Usernametokens inside the WS-Security Specifications if they doubt
its security. As I would like to say, --- &lt;strong&gt;Implementation is key&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
A Username token does &lt;strong&gt;&lt;em&gt;NOT&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;use any simpler or less-standard
security algorithm than any other tokens. In fact, it uses the same hashing algorithm,
symmetric algorithm such as the 128-key Cipher Block Chain (cbc) &lt;a href="http://www.cescomm.co.nz/about/aes.html" target=_blank&gt;Advanced
Encryption Standard&lt;/a&gt;, etc as any other token. Many people, also, do not realize
that the same symmetric algorithm is used to encrypt the SOAP message body when an&amp;nbsp;asymmetric
X509SecurityToken is used as well. The asymmetric key algorithm is&amp;nbsp;only used
to encrypt the secret&amp;nbsp;key that is doing the actual symmetric encryption processing.
This is done for the purpose of reducing cipher bloat and increasing processing speed.
The paranoia in me, however,&amp;nbsp;would go for a higher-bit key implementation, which
is possible.
&lt;/p&gt;
&lt;p&gt;
Remember that your secret can be stolen and kept for years and tried to be broken
with much higher-end and cheaper deciphering machines in the future. OK, OK, that
is my paraniod self talking. &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/smile.gif"&gt;
&lt;/p&gt;
&lt;p&gt;
I believe when statements are made against the security of Usernametokens, they are
made against the passwords of the Usernametokens. Therefore, the statement: "Usernametokens,
on their own they are only as secure as the passwords"
&lt;/p&gt;
&lt;p&gt;
Usernametokens are as secure as your passwords. That means that if you have a good
security policy on how your company treats passwords, ie...
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Minimum password length 
&lt;li&gt;
Implementation of alphanumeric and other different characters and symbols in password 
&lt;li&gt;
Password change frequency (in months instead of years &lt;img src="http://www.softwaremaker.net/pictures/swmemoticons/wink.gif"&gt;) 
&lt;li&gt;
Elimination of Weak Passwords such as using names and such 
&lt;li&gt;
...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
you should &lt;strong&gt;&lt;em&gt;NOT&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;be so fearful of using a Usernametoken
in your Web Service implementation.
&lt;/p&gt;
&lt;p&gt;
On the other hand, if you don't treat or administer your passwords with good&amp;nbsp;password
policies, then you cannot expect Usernametokens to give your message as secure a protection
as&amp;nbsp;you would like.
&lt;/p&gt;
&lt;p&gt;
I would also recommend using the PasswordOption.SendNone, if possible. The hash of
the password&amp;nbsp;and other elements are used to produce the cipher. NO password is
sent over using this enumerated option. Of course, the only caveat is except through
a dictionary attack, which&amp;nbsp;of course,&amp;nbsp;can be made so much more difficult
(or almost impossible) by having a good password policy administration system.
&lt;/p&gt;
&lt;p&gt;
If you have to send your Usernametoken over in PasswordOption.SendPlainText for whatever
reasons (using Windows, LDAP Authentication or you may have hashed versions of your
passwords stored in your UserDB), you&amp;nbsp;&lt;strong&gt;&lt;em&gt;SHOULD&lt;/em&gt;&lt;/strong&gt; encrypt
the UsernameToken with a X.509 digital certificate. Read my post &lt;a href="http://www.softwaremaker.net/blog/PermaLink,guid,43d85031-3e0b-48a7-bdd7-1f49932db40a.aspx" target=_blank&gt;here&lt;/a&gt; for
my own implementation of it.
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Another thing to take note is one that relates to the real world and why I believe
Usernametokens have its place here. It is easiest to implement and common in any business
environments. Therefore, it can be plugged into any existing IT systems with relatively
lesser effort. Also, X509 digital certs are usually used to authenticate machines
and / or companies, it would be more expensive and unrealistic to expect every user
in a 100+ user&amp;nbsp;organization to have a digital cert and a private / public key
pair. Therefore, I strongly believe that Usernametokens are more appt to authenticate
the users &lt;strong&gt;&lt;em&gt;themselves&lt;/em&gt;&lt;/strong&gt; in the real world and will continue
to be one of the most popular way to authenticate users in the near &lt;em&gt;biometric-less&lt;/em&gt; future.
However, if you are using authentication between machines, you &lt;strong&gt;&lt;em&gt;should&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;opt
for X509 digital certs instead.
&lt;/p&gt;
&lt;p&gt;
&lt;hr id=null&gt;
&lt;font color=#ff0000&gt;&lt;font face=Georgia&gt;[Author note] I believe WSE 2.0 SP2 has taken
some lengths to make sure that Usernametokens which transmits a clear text password
are now encrypted.&lt;/font&gt; &lt;/font&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#ff0000&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;font face=Georgia color=#ff0000&gt;For security reasons, it is strongly recommended
to encrypt Username tokens, especially when they contain password information. The &lt;b&gt;SecurityTokenServiceClient&lt;/b&gt; class
now automatically encrypts any &lt;b&gt;UsernameToken&lt;/b&gt; security tokens included in outgoing
SOAP requests. Similarly, the &lt;b&gt;SecurityTokenService&lt;/b&gt; class automatically encrypts
any &lt;b&gt;UsernameToken&lt;/b&gt; security tokens included in outgoing SOAP responses.&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=20f8fcb0-a5eb-41b4-8ddf-217f4e338cf1" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Software Architectures;Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=aaa1d757-7c04-44d9-b469-95a0a790448b</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,aaa1d757-7c04-44d9-b469-95a0a790448b.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
For all those wanting to do WS-ReliableMessaging today with WSE 2.0, you can check
out what Andrés has done <a href="http://weblogs.asp.net/andresv/archive/2004/11/28/271255.aspx" target="_blank">here</a>.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=aaa1d757-7c04-44d9-b469-95a0a790448b" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>WS-ReliableMessaging for WSE 2.0 - Way Cool</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,aaa1d757-7c04-44d9-b469-95a0a790448b.aspx</guid>
      <link>http://www.softwaremaker.net/blog/WSReliableMessagingForWSE20WayCool.aspx</link>
      <pubDate>Mon, 29 Nov 2004 08:25:11 GMT</pubDate>
      <description>&lt;p&gt;
For all those wanting to do WS-ReliableMessaging today with WSE 2.0, you can check
out what Andr&amp;#233;s has done &lt;a href="http://weblogs.asp.net/andresv/archive/2004/11/28/271255.aspx" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=aaa1d757-7c04-44d9-b469-95a0a790448b" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=1508b8a2-a4f5-49a3-beb4-15725f0b0f59</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <title>Security Headers, Intermediaries and the next Actor Attribute</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,1508b8a2-a4f5-49a3-beb4-15725f0b0f59.aspx</guid>
      <link>http://www.softwaremaker.net/blog/SecurityHeadersIntermediariesAndTheNextActorAttribute.aspx</link>
      <pubDate>Sat, 27 Nov 2004 10:18:35 GMT</pubDate>
      <description>&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;Had a good brief chat with Plumbers: &lt;a href="http://www.bristowe.com/blog/" target=_blank&gt;John
Bristowe&lt;/a&gt; and &lt;a href="http://hyperthink.net/blog/" target=_blank&gt;Steve Maine&lt;/a&gt; on
this issue&lt;span class=442385200-26112004&gt;.&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;span class=442385200-26112004&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;span class=442385200-26112004&gt;&lt;strong&gt;[Just added: &lt;/strong&gt;&lt;a href="http://www.dynamic-cast.com/" target=_blank&gt;&lt;strong&gt;Hervey
Wilson&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; [Dev Lead of WSE] has &lt;/strong&gt;&lt;a href="http://www.dynamic-cast.com/mt-archives/000069.html" target=_blank&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; to
reply to this post.. Thanks Hervey for your thoughts on this issue.]&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt; 
&lt;hr id=null&gt;
My confusion seems to come from reading the WS-Security specs on both MSDN and OASIS.
The MSDN copy that wasnt the OASIS standard says and incidentally was implemeted through
WSE 1.0 :&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial color=#ff0000 size=2&gt;&lt;em&gt;&lt;strong&gt;An intermediary on the message
path MAY add one or more new sub-elements to an existing &amp;lt;Security&amp;gt; header block
if they are targeted for the same SOAP node&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;However, the same specs on OASIS reads:&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;em&gt;&lt;/em&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial color=#ff0000 size=2&gt;&lt;em&gt;&lt;strong&gt;An active intermediary on the
message path MAY add one or more new sub-elements to an existing &amp;lt;wsse:Security&amp;gt;
header block if they are targeted for its SOAP node&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;/em&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;IMHO, that IS a whole lot of difference. The first specs
indicate that you can change the securityHeaders if they are going to the same soap
node. In this case, if I am assuming that the same soap node = ulitmate receiver,
I can basically access something NOT meant for me.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;However, the&amp;nbsp;&lt;span class=442385200-26112004&gt;meaning
on the &lt;/span&gt;OASIS one is&amp;nbsp;&lt;span class=442385200-26112004&gt;slightly &lt;/span&gt;different.
It says that I can change the securityHeaders if it is meant for itself (its SOAP
node). That changed the whole thing quite a bit. It doesnt say now that I can change
or add additional elements into the securityHeaders for the ultimate receiver. To
be honest, and I have read this line many times to make sure I got the context right,
I dont see the point in adding any sub-elements to a security header block that is
targetted at itself. It doesnt really make much sense, if any, at all.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;John is definitely right in saying that I shouldnt be
trying to use security headers targeted for&amp;nbsp;the ultimate receiver&amp;nbsp;inside
the context of&amp;nbsp;a SOAP intermediary.&amp;nbsp;In most cases, the security element(s)
targeted for the final destination will be signed. Therefore, providing access via
the object model doesn't make sense because manipulating these headers would invalidate
the digital signature.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;I definitely agree with him on this. That is one of the
reasons why WS-Routing was superseded by WS-Addressing.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;And of course, WSE 2.0 implements the OASIS-standard
WS-Security Specs.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;However, I&amp;nbsp;am looking at the&amp;nbsp;idea&amp;nbsp;of taking
the securityHeaders meant for someone else that arent signed and sign it. The final
SOAP actor can and will only accept a message that is signed by&amp;nbsp;&lt;span class=442385200-26112004&gt;its
adjacent node&lt;/span&gt;&amp;nbsp;and NOT the initial actor, per se. &lt;/font&gt;&lt;font face=Arial size=2&gt;Does
this idea sound far-fetched ?
&lt;/div&gt;
&lt;div&gt;
&lt;hr id=null&gt;
&lt;/div&gt;
&gt; 
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;I have done some reading into the WS-Security Specs and
also cracked open [&lt;em&gt;aka Reflect()&lt;/em&gt;] WSE 2.0 to see how it implements and processes
the Security Headers. &lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;&lt;span class=442385200-26112004&gt;First of all, do
take note of this&amp;nbsp;&lt;/span&gt;very important specification block found in the OASIS-standard
WS-Security Specs.&lt;/font&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial color=#ff0000 size=2&gt;&lt;em&gt;&lt;strong&gt;&amp;#8220;The header block provides
a mechanism for attaching security-related information targeted at a specific recipient
in the form of a SOAP actor/role. This may be either the ultimate recipient of the
message or an intermediary. Consequently, elements of this type may be present multiple
times in a SOAP message. An active intermediary on the message path MAY add one or
more new sub-elements to an existing header block if they are targeted for its SOAP
node or it MAY add one or more new headers for additional targets. As stated, a message
MAY have multiple header blocks if they are targeted for separate recipients. However,
only one header block MAY omit the S11: actor or S12: role attributes. Two header
blocks MUST NOT have the same value for S11: actor or S12: role. Message security
information targeted for different recipients MUST appear in different header blocks.
This is due to potential processing order issues (e.g. due to possible header re-ordering).
The header block without a specified S11: actor or S12: role MAY be processed by anyone,
but MUST NOT be removed prior to the final destination or endpoint..."&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;This boils down to another
interesting fundamental concept of trust here which Steve Maine talks about &lt;a href="http://hyperthink.net/blog/PermaLink,guid,97388cbb-fd2c-4fd2-8347-1b0770c776e4.aspx" target=_blank&gt;here&lt;/a&gt;&amp;nbsp;in
which he &lt;/font&gt;&lt;/span&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;asked
if Trust is Point-to-Point or End-to-End ?&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;The intermediary is a
very important concept of SOAP Routing extensibility and is pretty much explains the
processing model of SOAP messages. An intermediary sits between the initial sender
and the ultimate receiver and intercepts SOAP messages. An intermediary acts as both
a SOAP sender and a SOAP receiver at the same time. Intermediary nodes make it possible
to design some interesting and flexible networking architectures that can be influenced
by message content.&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font size=2&gt;&lt;font face=Arial&gt;While processing a message, a SOAP node assumes
one or more roles that influence how SOAP headers are processed. &lt;/font&gt;&lt;/font&gt;&lt;font size=+0&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial size=2&gt;SOAP
1.1 only defines a single role named &lt;b&gt;http://schemas.xmlsoap.org/soap/actor/next&lt;/b&gt; (&lt;i&gt;next, &lt;/i&gt;for
short). Every SOAP node is required to assume the &lt;i&gt;next &lt;/i&gt;role. Hence, when a
SOAP message arrives at any given SOAP node, the node must process all mandatory headers
targeted at the &lt;i&gt;next &lt;/i&gt;role, and it may choose to process optional headers also
targeted at the &lt;i&gt;next &lt;/i&gt;role. In addition to &lt;i&gt;next, &lt;/i&gt;SOAP 1.2 adds two new
predefined roles to the existing "&lt;strong&gt;&lt;em&gt;Next&lt;/em&gt;&lt;/strong&gt;" role in SOAP 1.1
which is the "&lt;strong&gt;&lt;em&gt;None&lt;/em&gt;&lt;/strong&gt;" and the "&lt;strong&gt;&lt;em&gt;Ultimate Receiver&lt;/em&gt;&lt;/strong&gt;"
role.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;
&lt;font face=Arial size=2&gt;SOAP headers target specific roles through the global &lt;b&gt;actor&lt;/b&gt; attribute
(SOAP 1.&lt;span class=442385200-26112004&gt;1&lt;/span&gt;). When&amp;nbsp;you send a SOAP message
to a receiving service&amp;nbsp;without specifying the actor value, the actor attribute
will be absent from the header&lt;span class=442385200-26112004&gt;.&amp;nbsp;In this case&lt;/span&gt;,
the header is targeted at the ultimate receiver by default.&lt;span class=442385200-26112004&gt; &lt;/span&gt;If
a SOAP node successfully processes a header, it&lt;span class=442385200-26112004&gt; &lt;strong&gt;&lt;em&gt;MUST&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;remove
the header from the message. SOAP nodes are allowed to reinsert headers, but doing
so changes the contract parties&amp;#8212;it's now between the current node and the next
node the header targets&lt;span class=442385200-26112004&gt; (&lt;strike&gt;Point-to-Point&lt;/strike&gt; Node-to-Node
Trust ?)&lt;/span&gt;.&lt;/font&gt;&gt;&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span class=442385200-26112004&gt;&lt;font face=Arial&gt;&lt;font size=2&gt;In WSE 2.0,&amp;nbsp;security
headers can be processed if any of the following conditions are true:&lt;/font&gt; 
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;font face=Arial size=2&gt;Actor is equal to ActorNext. &lt;/font&gt; 
&lt;li&gt;
&lt;font face=Arial size=2&gt;Actor matches this node. &lt;/font&gt; 
&lt;li&gt;
&lt;font face=Arial size=2&gt;Actor is empty and the IsIntermediary property of context
is false .&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size=2&gt;From my understanding of the above, an endpoint (not an intermediary)&amp;nbsp;should
assume 3 roles --- Its own role, an actorless security header and also must process
one that says &lt;em&gt;&lt;strong&gt;next&lt;/strong&gt;.&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=2&gt;However, if I send 2 security headers (one for "&lt;a href="http://schemas.xmlsoap.org/soap/actor/next"&gt;http://schemas.xmlsoap.org/soap/actor/next&lt;/a&gt;"
and the other doesnt have an actor attribute) to an&amp;nbsp;endpoint.asmx, it fails with
a "&lt;em&gt;&lt;strong&gt;&lt;font color=#ff0000&gt;The &amp;lt;EncryptedData&amp;gt; element referenced by
the &amp;lt;ReferenceList&amp;gt; in the Security header could not be found&lt;/font&gt;&lt;/strong&gt;&lt;/em&gt;"
exception. I did some tracing and found that the later security header with the &lt;em&gt;&lt;strong&gt;next&lt;/strong&gt;&lt;/em&gt; role
is appended to the security header with the actorless attribute. I believe it should
have been &lt;strong&gt;&lt;em&gt;prepended&lt;/em&gt;&lt;/strong&gt; instead.&lt;/font&gt;
&lt;/p&gt;
&gt;&gt; 
&lt;div&gt;&lt;font face=Arial size=2&gt;Cracking open the&amp;nbsp;IL on&amp;nbsp;SecurityInputFilter
further reveals this.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;There is a CanProcessHeader method that looks for the
actorless attribute first, once it finds it, it processes it and removes it. Then,
it then look for the ActorNext URI role.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;This will not work in my case as the intermediary which
has inserted the later &lt;em&gt;&lt;strong&gt;next&lt;/strong&gt;&lt;/em&gt; role security header by encrypting
the SOAP message a &lt;em&gt;&lt;strong&gt;second&lt;/strong&gt;&lt;/em&gt; time needs to be processed and
decrypted first. The CanProcessHeader method will definitely fail as it cannot find
the actorless security header referenced security token without decrypting it with
the tokens found in the&amp;nbsp;&lt;em&gt;next&lt;/em&gt;&amp;nbsp;role security header first. However,&amp;nbsp;WSE
looks for the actorless attribute header first.&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;...&lt;/span&gt;
&lt;br&gt;
...&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; text1 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; header.GetAttribute(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"actor"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"http://schemas.xmlsoap.org/soap/envelope/"&lt;/span&gt;);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (text1.Length
== 0)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (context.IsIntermediary)&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
Uri uri1 &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; Uri(text1);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (!uri1.Equals(Soap.ActorNextURI)
&amp;amp;&amp;amp; !uri1.Equals(context.Actor))&lt;br&gt;
{&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;false&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;;&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;I suppose I can try to re-arrange the security headers
to a proper sequence although I would hate to do that (Am I supposed to be even doing
that ?).&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;The funny thing is that if I choose not to encrypt the
body a second time and instead just add the &lt;em&gt;next&lt;/em&gt; role attribute security
header instead (which means this second security header does nothing), it still throws
me an exception&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial color=#ff0000 size=2&gt;&lt;strong&gt;&lt;em&gt;Microsoft.Web.Services2.Security.SecurityFault:
An error was discovered processing the &amp;lt;Security&amp;gt; header&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;Could someone shed some light on this issue. Is an endpoint
supposed to take on the role of the next actor attribute ? If so, shouldn't the security
headers with a SOAP &lt;em&gt;&lt;strong&gt;next&lt;/strong&gt;&lt;/em&gt; role attribute (which is very likely
to be input from an intermediary) be &lt;strong&gt;&lt;em&gt;prepended&lt;/em&gt;&lt;/strong&gt; to the actorless
security header instead or is this a bug in&amp;nbsp;WSE ?&lt;/font&gt;
&lt;/div&gt;
&lt;div&gt;&lt;font face=Arial&gt;&lt;/font&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;font face=Arial size=2&gt;&lt;span class=442385200-26112004&gt;&lt;strong&gt;[Just added: &lt;/strong&gt;&lt;a href="http://www.dynamic-cast.com/" target=_blank&gt;&lt;strong&gt;Hervey
Wilson&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; [Dev Lead of WSE] has &lt;/strong&gt;&lt;a href="http://www.dynamic-cast.com/mt-archives/000069.html" target=_blank&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; to
reply to this post.. Thanks Hervey for your thoughts on this issue.]&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=1508b8a2-a4f5-49a3-beb4-15725f0b0f59" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=b01ff393-28f1-4c66-b527-6c8a1a26cfad</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,b01ff393-28f1-4c66-b527-6c8a1a26cfad.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have noticed Rich Salz's absence for a rather long time and he comes back to
give <a href="http://www.w3.org/TR/wsdl20/" target="_blank">WSDL 2.0</a> a <a href="http://www.xml.com/pub/a/2004/11/17/salz.html" target="_blank">kick
in the head</a>.
</p>
        <p>
Looks like I have to reserve my comments until I read through those specs.
</p>
        <p>
Frankly though, I am rather disappointed with the handling of the later XML Services
Specs by W3C and this is not just the beef I have to pick with W3C.
</p>
        <p>
W3C's definition of SOA goes like this:
</p>
        <p>
          <strong>“A set of components which can be invoked and whose interface descriptions
can be published and discovered”</strong>
        </p>
        <p>
Hell, why not they just say its XML Web Services ? This is just a plain crappy, poorly
thought of definition.
</p>
        <p>
And it contributes to all the market <em><strong>mis</strong></em>-definitions of
_SO(A)_ where the terms SO(A) and XML Web Services, although tightly-linked, are NOT <strong>synonymous.</strong></p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=b01ff393-28f1-4c66-b527-6c8a1a26cfad" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Giving WSDL 2.0 a whooping</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,b01ff393-28f1-4c66-b527-6c8a1a26cfad.aspx</guid>
      <link>http://www.softwaremaker.net/blog/GivingWSDL20AWhooping.aspx</link>
      <pubDate>Sun, 21 Nov 2004 07:48:41 GMT</pubDate>
      <description>&lt;p&gt;
I have noticed Rich Salz's absence&amp;nbsp;for a rather long time and he comes back to
give &lt;a href="http://www.w3.org/TR/wsdl20/" target=_blank&gt;WSDL 2.0&lt;/a&gt; a &lt;a href="http://www.xml.com/pub/a/2004/11/17/salz.html" target=_blank&gt;kick
in the head&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Looks like I have to reserve my comments until I read through those specs.
&lt;/p&gt;
&lt;p&gt;
Frankly though, I am rather disappointed with the handling of the later XML Services
Specs by W3C and this is not just the beef I have to pick with W3C.
&lt;/p&gt;
&lt;p&gt;
W3C's definition of SOA goes like this:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&amp;#8220;A set of components which can be invoked and whose interface descriptions
can be published and discovered&amp;#8221;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Hell, why not they just say its XML Web Services ? This is just a plain crappy, poorly
thought of definition.
&lt;/p&gt;
&lt;p&gt;
And it contributes to all the market &lt;em&gt;&lt;strong&gt;mis&lt;/strong&gt;&lt;/em&gt;-definitions of
_SO(A)_ where the terms SO(A) and XML Web Services, although tightly-linked, are NOT &lt;strong&gt;synonymous.&lt;/strong&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=b01ff393-28f1-4c66-b527-6c8a1a26cfad" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Service-Orientation;WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=371862d9-5622-4bc7-a6d6-5581b9eea12e</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,371862d9-5622-4bc7-a6d6-5581b9eea12e.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I came across some questions pertaining to how the asymmetric keys of <a title="X.509 PKI Digital Certificates" href="http://www.ietf.org/html.charters/pkix-charter.html" target="_blank"></a><a href="http://www.ietf.org/html.charters/pkix-charter.html" target="_blank">X.509
PKI Digital Certificates</a> are being transmiited during SOAP Message exchanges for
both <a title="XML-Encryption" href="http://www.w3.org/TR/xmlenc-core/" target="_blank">XML-Encryption</a> and <a title="XML-Digital Signature" href="http://www.w3.org/TR/xmldsig-core/" target="_blank">XML-Digital
Signature</a>.
</p>
        <p>
There seems to be some sort of slight confusion here so I will explain in a more user-friendly
fashion here.
</p>
        <p>
Although <a title="XML-Encryption" href="http://www.w3.org/TR/xmlenc-core/" target="_blank">XML-Encryption</a> and <a title="XML-Digital Signature" href="http://www.w3.org/TR/xmldsig-core/" target="_blank">XML-Digital
Signature</a> works on the same fundamental principles, they are implemented rather
differently. I will not go into details on how they work on top of Factoring, Prime
Numbers and such as these are topics that will not fit into one blog post. You may
want to go <a href="http://www.fact-index.com/p/pu/public_key_cryptography.html" target="_blank">here</a> to
find out more. To put it simply:
</p>
        <ol>
          <li>
If Alice wants to encrypt a message just for Bob, Alice will encrypt the message using
Bob's (Publicly-available) Public Key, which, Bob's (Secretly-held) Private Key
can decrypt once he received the message 
</li>
          <li>
If Alice wants to sign a message, Alice will encrypt the message using her (Secretly-held)
Private Key and then anyone with Alice's (Publicly-available) Public Key will be able
to verfy that the message was authentic and signed by Alice only.</li>
        </ol>
        <p>
If you scrutinize these 2 key principles enough, you will realize that there is a
key differing implementation detail.
</p>
        <p>
Now, lets go into how WSE 2.0 implements <a title="WS-Security Specifications" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target="_blank"></a>OASIS
WS-Security Specifications riding on top of ASMX XML Web Services.
</p>
        <p>
To be true to myself and how I would try to use the term <a href="http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/07/25/20245.aspx" target="_blank">XML
Services</a> whenever I can, I would also avoid the use of client-server whenever
I can and use the term Publisher-Subscriber instead.
</p>
        <p>
For simplicity's sake, I assume the following:
</p>
        <ul>
          <li>
[PublisherCode] is always going to return "Hello World" 
</li>
          <li>
[PublisherCode] Response Stream is just going to be plain simple vanilla message with
NO fat and trimmings 
</li>
          <li>
ONLY X509 Asymmetric Encryption Public Private Key Pairs are used here 
</li>
          <li>
Alice is the Subscriber while Bob plays the role of the Publisher</li>
        </ul>
        <p>
          <strong>For Scenario 1 XML-Encryption</strong>
          <hr id="null" />
          <strong>[PublisherCode]</strong>
          <font face="Georgia" color="#0000ff" size="2">
            <em> </em>
          </font>
        </p>
        <p>
        </p>
        <font face="Georgia" color="#000080" size="2">
          <em>
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;WebMethod()&gt;
_<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span> HelloWorld() <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">String</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Hello
World"</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span></span>
            </p>
          </em>
        </font>
        <p>
          <strong>[SubscriberCode]</strong>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> a <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> IndexWse <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> IndexWse<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> store <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> X509CertificateStore <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> _<br />
X509CertificateStore.CurrentUserStore(X509CertificateStore.OtherPeople)<br />
store.OpenRead()<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> cert <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> X509Certificate <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> store.FindCertificateByKeyIdentifier
_<br />
(Convert.FromBase64String(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"bBwPfItvKp3b6TNDq+14qs58VJQ="</span>))(0)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> xTok <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> X509SecurityToken(cert)<br /><br />
a.RequestSoapContext.Security.Elements.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> EncryptedData(xTok))<br /><br />
MessageBox.Show(a.HelloWorld)</span>
        </p>
        <p>
          <strong>[Resultant Request SOAP Message in brief]</strong>
          <br />
...<br /><font face="Georgia" color="#000080" size="2"><em>  &lt;xenc:EncryptedKey xmlns:xenc="</em></font><a href="http://www.w3.org/2001/04/xmlenc"><font face="Georgia" color="#000080" size="2"><em>http://www.w3.org/2001/04/xmlenc</em></font></a><font face="Georgia" color="#000080" size="2"><em>#"&gt;<br />
  &lt;xenc:EncryptionMethod Algorithm="</em></font><a href="http://www.w3.org/2001/04/xmlenc#rsa-1_5"><font face="Georgia" color="#000080" size="2"><em>http://www.w3.org/2001/04/xmlenc#rsa-1_5</em></font></a><font face="Georgia" color="#000080" size="2"><em>"
/&gt; 
<br />
  &lt;KeyInfo xmlns="</em></font><a href="http://www.w3.org/2000/09/xmldsig"><font face="Georgia" color="#000080" size="2"><em>http://www.w3.org/2000/09/xmldsig</em></font></a><font face="Georgia" color="#000080" size="2"><em>#"&gt;<br />
  &lt;wsse:SecurityTokenReference&gt;<br />
  &lt;wsse:KeyIdentifier ValueType="</em></font><a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509"><font face="Georgia" color="#000080" size="2"><em>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509</em></font></a><font face="Georgia" color="#000080" size="2"><em>  </em></font></p>
        <p>
          <font face="Georgia" color="#000080" size="2">
            <em>SubjectKeyIdentifier"&gt;bBwPfItvKp3b6TNDq+14qs58VJQ=&lt;/wsse:KeyIdentifier&gt; 
<br />
  &lt;/wsse:SecurityTokenReference&gt;<br />
  &lt;/KeyInfo&gt;<br />
  &lt;xenc:CipherData&gt;<br />
  &lt;xenc:CipherValue&gt;XFMDuiWzvjOVA9k</em>
          </font>
          <font face="Georgia" color="#000080" size="2">
            <em>FThrkUo=&lt;/xenc:CipherValue&gt; 
<br />
  &lt;/xenc:CipherData&gt;<br />
  &lt;xenc:ReferenceList&gt;<br />
  &lt;xenc:DataReference URI="#EncryptedContent-e8284f45-0a66-409d-a5e2-c041b648fbac"
/&gt; 
<br />
  &lt;/xenc:ReferenceList&gt;<br />
  &lt;/xenc:EncryptedKey&gt;<br />
...</em>
          </font>
        </p>
        <p>
          <strong>[Comments]</strong>
          <br />
Since Alice is encrypting something specific for Bob's eyes only, Alice need to explicity
get Bob's (Publicly-available) Public Key. This has to be an explicit assumption to
make. This can be done in many ways which traditionally make take some out-of-band
approach. In our case above, Bob's Public Key is installed on my machine in the CurrentUserStore\OtherPeople
key store. Bob can then use his (Secretly-held) Private Key to decrypt the cipher
in the message. This is a very end-user specific approach. It is unlikely Alice will
be encrypting something that she wants the whole world to see. Therefore, the Publisher
(Bob) can be sure that the X509 SubjectKeyIdentifier of "bBwPfItvKp3b6TNDq+14qs58VJQ=",
which contains his (Secretly-held) Private Key, can be found in his key store of the
machine. It would be a fairly safe assumption to make.
</p>
        <p>
          <strong>For Scenario (2) XML-Digital Signature</strong>
          <hr id="null" />
          <strong>[PublisherCode]</strong>
        </p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;WebMethod()&gt;
_<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span> HelloWorld() <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">String</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Hello
World"</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span></span>
        </p>
        <p>
          <strong>[SubscriberCode]</strong>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> a <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> IndexWse <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> IndexWse<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> store <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> X509CertificateStore <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> _<br />
X509CertificateStore.CurrentUserStore(X509CertificateStore.MyStore)<br />
store.OpenRead()<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> cert <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> X509Certificate <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> store.FindCertificateByKeyIdentifier
_<br />
(Convert.FromBase64String(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"gBfo0147lM6cKnTbbMSuMVvmFY4="</span>))(0)<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> xTok <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> X509SecurityToken(cert)<br /><br />
a.RequestSoapContext.Security.Tokens.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(xTok)<br />
a.RequestSoapContext.Security.Elements.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">New</span> MessageSignature(xTok))<br /><br />
MessageBox.Show(a.HelloWorld)</span>
        </p>
        <p>
          <strong>[Resultant Request SOAP Message in brief]</strong>
          <br />
          <em>
            <font face="Georgia" color="#000080" size="2">...<br />
  &lt;wsse:BinarySecurityToken ValueType="</font>
          </em>
          <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">
            <em>
              <font face="Georgia" color="#000080" size="2">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">EncodingType="</font>
          </em>
          <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">
            <em>
              <font face="Georgia" color="#000080" size="2">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">wsu:Id="SecurityToken-7b5d8096-928a-45d2-b504-d0bfb84eab41"&gt;MIIBxDCCAW6gAwIBAgIQxU</font>
          </em>
          <em>
            <font face="Georgia" color="#000080" size="2">PYdu2fPMER8ajJfl&lt;/wsse:BinarySecurityToken&gt;<br />
 <br />
  &lt;Signature xmlns="</font>
          </em>
          <a href="http://www.w3.org/2000/09/xmldsig">
            <em>
              <font face="Georgia" color="#000080" size="2">http://www.w3.org/2000/09/xmldsig</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">#"&gt;<br />
  &lt;SignedInfo&gt;<br />
  &lt;CanonicalizationMethod Algorithm="</font>
          </em>
          <a href="http://www.w3.org/2001/10/xml-exc-c14n">
            <em>
              <font face="Georgia" color="#000080" size="2">http://www.w3.org/2001/10/xml-exc-c14n</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">#"
/&gt; 
<br />
  &lt;SignatureMethod Algorithm="</font>
          </em>
          <a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1">
            <em>
              <font face="Georgia" color="#000080" size="2">http://www.w3.org/2000/09/xmldsig#rsa-sha1</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">"
/&gt; 
<br />
  &lt;Reference URI="#Id-f7e1c0fa-e3da-4cb4-be53-f583153bc588"&gt;<br />
  &lt;Transforms&gt;<br />
  &lt;Transform Algorithm="</font>
          </em>
          <a href="http://www.w3.org/2001/10/xml-exc-c14n">
            <em>
              <font face="Georgia" color="#000080" size="2">http://www.w3.org/2001/10/xml-exc-c14n</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">#"
/&gt; 
<br />
  &lt;/Transforms&gt;<br />
  &lt;DigestMethod Algorithm="</font>
          </em>
          <a href="http://www.w3.org/2000/09/xmldsig#sha1">
            <em>
              <font face="Georgia" color="#000080" size="2">http://www.w3.org/2000/09/xmldsig#sha1</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">"
/&gt; 
<br />
  &lt;DigestValue&gt;avMezj5NhZwNerXidi5oBmjqi/g=&lt;/DigestValue&gt; 
<br />
  &lt;/Reference&gt;<br />
  ...<br />
  &lt;/SignedInfo&gt;<br />
  </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">&lt;SignatureValue&gt;JfnqZeDHboWDI2n2gW</font>
          </em>
          <em>
            <font face="Georgia" color="#000080" size="2">=&lt;/SignatureValue&gt; 
<br />
  &lt;KeyInfo&gt;<br />
  &lt;wsse:SecurityTokenReference&gt;<br />
  &lt;wsse:Reference URI="#SecurityToken-7b5d8096-928a-45d2-b504-d0bfb84eab41" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">ValueType="</font>
          </em>
          <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">
            <em>
              <font face="Georgia" color="#000080" size="2">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">"
/&gt; 
<br />
  &lt;/wsse:SecurityTokenReference&gt;<br />
  &lt;/KeyInfo&gt;<br />
  &lt;/Signature&gt;<br />
...</font>
          </em>
        </p>
        <p>
          <strong>[Comments]<br /></strong>If you look closely at the subscriber code, you will notice a few differences.
First, Alice is using her (Secretly-held) Private Key to sign the message. Then she
attaches the X509 Digital Certificate to the message. WSE2.0 is smart enough to know
that ONLY the Public-Key pair of the X509 Digital Certificate goes out in SOAP on
the wire. This is encapsulated in the &lt;wsse:BinarySecurityToken&gt; element in
the SOAP Header. Why the difference ? Because a signed message by Alice is for any
and everyone to verify and therefore Alice cannot assume that any and everyone has
got a copy of her Public Key. In this case, she has to attach her Public Key in the
X509 Cert to her SOAP Request Message so that anyone getting hold of her Public-Key
can verify that ONLY she (Alice) can sign the message. The &lt;wsse:BinarySecurityToken&gt;
element, in this case, actually contains a Base64 Binary Respresentation of Alice's
Public Key X509 Certificate.
</p>
        <p align="center">
          <font face="Verdana" color="#ff0000">
            <strong>Now, can you spot the hack here ?</strong>
          </font>
        </p>
        <p>
If Mallet of Man-In-The-Middle chances upon this message, he can actually signed the
SOAP Message elements with his (Secretly-held) Private Key. Then he can replaced Alice's
&lt;wsse:BinarySecurityToken&gt; element with his own Base64 Binary Respresentation
of Mallet's Public Key X509 Certificate. If Mallet succeeds in doing so, and this
can be fairly straightforward and easy to implement (I may blog about how to do this
in a later post), the SOAP Message received is actually cryptographically verified
to be accurate even though the trust has failed because of the Untrusted Public Key.
</p>
        <p>
So, what can Bob do ? Well, Bob has got 2 choices BUT both require some out-of-band
communication with Alice. There has to be some kind of communication work done before
trust can actually be established. You really cannot run away from it.
</p>
        <p>
          <strong>1)</strong>
          <strong>Bob can implement a Trust Verification at the Application
Layer</strong>
          <hr id="null" />
          <strong>[PublisherCode]</strong>
        </p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;WebMethod()&gt;
_<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span> HelloWorld() <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">String</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> xtok <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> X509SecurityToken <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> GetSigningToken(RequestSoapContext.Current)<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">If</span> xtok.Certificate.GetCertHashString <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> RetrieveFromListofTrustedThumbPrints<br /><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">OR</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">If</span> xtok.KeyIdentifier.Value <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> RetrieveFromListofTrustedKeyIdentifiers<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Hello
World"</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Shared</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span> GetSigningToken(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ByVal</span> context <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> SoapContext) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> SecurityToken<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> element <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> ISecurityElement<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">For</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Each</span> element <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">In</span> context.Security.Elements<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">If</span> (<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TypeOf</span> (element) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Is</span> MessageSignature) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Then</span><br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'
The context contains a Signature element. </span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Dim</span> sign <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span> MessageSignature <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> element<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'
The SOAP body is signed</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span> sign.SigningToken<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">If</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Next</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Nothing</span><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'
GetSigningToken</span></span>
        </p>
        <p>
          <strong>[Comments]</strong>
          <br />
As you can see, the message is allowed through and Bob checks it at the application
level. He can either verify via the Digital Certificate's Thumbprint which is exposed
via the GetCertHashString property or the Digital Certificate's KeyIdentifier which,
in this case, happens to be "gBfo0147lM6cKnTbbMSuMVvmFY4=" One drawback on this method
is that message is allowed through to the application layer and certain resources
are invoked to check for the trust of the sender.
</p>
        <p>
          <strong>2) Bob can implement a Trust Verification at the WS-Policy Level 
<hr id="null" />
[PublisherCode]</strong>
        </p>
        <p>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">&lt;WebMethod()&gt;
_<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span> HelloWorld() <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">As</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">String</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Return</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Hello
World"</span><br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">End</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Function</span></span>
        </p>
        <p>
          <strong>[WS-Policy File in brief]</strong>
          <br />
          <em>
            <font face="Georgia" color="#000080" size="2">...<br />
  &lt;request policy="#Sign-X.509" /&gt;<br />
  ...<br />
  &lt;policies xmlns:wsu="</font>
          </em>
          <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <em>
              <font face="Georgia" color="#000080" size="2">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">xmlns:wsp="</font>
          </em>
          <a href="http://schemas.xmlsoap.org/ws/2002/12/policy">
            <em>
              <font face="Georgia" color="#000080" size="2">http://schemas.xmlsoap.org/ws/2002/12/policy</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">"
xmlns:wssp="</font>
          </em>
          <a href="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <em>
              <font face="Georgia" color="#000080" size="2">http://schemas.xmlsoap.org/ws/2002/12/secext</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">xmlns:wse="</font>
          </em>
          <a href="http://schemas.microsoft.com/wse/2003/06/Policy">
            <em>
              <font face="Georgia" color="#000080" size="2">http://schemas.microsoft.com/wse/2003/06/Policy</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">xmlns:wsse="</font>
          </em>
          <a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <em>
              <font face="Georgia" color="#000080" size="2">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">" </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">xmlns:wsa="</font>
          </em>
          <a href="http://schemas.xmlsoap.org/ws/2004/03/addressing">
            <em>
              <font face="Georgia" color="#000080" size="2">http://schemas.xmlsoap.org/ws/2004/03/addressing</font>
            </em>
          </a>
          <em>
            <font face="Georgia" color="#000080" size="2">"&gt;<br />
   &lt;wsp:Policy wsu:Id="Sign-X.509"&gt;<br />
   ...<br />
   &lt;wssp:Integrity wsp:Usage="wsp:Required"&gt;<br />
   &lt;wssp:TokenInfo&gt;<br />
   &lt;wssp:SecurityToken wse:IdentityToken="true"&gt;<br />
   ...            </font>
          </em>
        </p>
        <p>
          <em>
            <font face="Georgia" color="#000080" size="2">&lt;wssp:TokenType&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&lt;/wssp:TokenType&gt;<br />
   &lt;wssp:TokenIssuer&gt;CN=Root Agency&lt;/wssp:TokenIssuer&gt;<br />
   &lt;wssp:Claims&gt;<br />
   ...<br />
   &lt;wssp:SubjectName MatchType="wssp:Exact"&gt;CN=WSE2QuickStartClient&lt;/wssp:SubjectName&gt;<br />
   &lt;wssp:X509Extension OID="2.5.29.14" MatchType="wssp:Exact"&gt;gBfo0147lM6cKnTbbMSuMVvmFY4=&lt;/wssp:X509Extension&gt;<br />
   &lt;/wssp:Claims&gt;<br />
   &lt;/wssp:SecurityToken&gt;<br />
   &lt;/wssp:TokenInfo&gt;<br />
   ...<br />
   &lt;/wsp:Policy&gt;<br />
  &lt;/policies&gt;<br />
...</font>
          </em>
        </p>
        <p>
          <strong>[Comments]</strong>
          <br />
As you can see, this method is so much cleaner and neater. Messages will fail at the
Policy Pipleine level and will NOT reach Bob's application code itself. See that the
HelloWorld WebMethod has no extra trimmings and fat. The policy file dictates that
the X509 Digital Certificate coming in must have SubjectName = CN=WSE2QuickStartClient
AND KeyIdentifier = gBfo0147lM6cKnTbbMSuMVvmFY4=
</p>
        <p>
If the SOAP Requests carrying the &lt;wsse:BinarySecurityToken&gt; element doesnt
meet these policy demands, an exception is thrown. Beautiful ! Of course, technically
speaking, resources are still being invoked to check for these demands but they happen
at the policy-assertion level of the WSE pipelines which are abstracted away from
the developer, thus allowing these developers to focus on the business logic itself.
Application code is definitely cleaner and more maintainable.
</p>
        <p>
Both methods, though slightly different, work on a major principle of assumption that
Alice and Bob have established some kind of communication channel between them or
amongst others where Trusted KeyIdentifiers or Thumbprints are exchanged. It also
highlights the fact on how important having a common trusted root Cert Authority that
can be verifiable such as Verisign or Checkpoint is.
</p>
        <p>
This blog post, long as it is, highlights some major points. We dont live in a secure
world and this is the only thing we can assume safely. Verifying a signed message
is NOT as simple as it may seem. There has to be some kind of out-of-band approach
to ascertain trust between partners because validation of the message, as we can see
from the above example, is definitely NOT enough.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=371862d9-5622-4bc7-a6d6-5581b9eea12e" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>WS-Security, BinarySecurityToken and the Verification of Signature Authors</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,371862d9-5622-4bc7-a6d6-5581b9eea12e.aspx</guid>
      <link>http://www.softwaremaker.net/blog/WSSecurityBinarySecurityTokenAndTheVerificationOfSignatureAuthors.aspx</link>
      <pubDate>Sat, 20 Nov 2004 08:19:49 GMT</pubDate>
      <description>&lt;p&gt;
I came across some questions pertaining to how the asymmetric keys of&amp;nbsp;&lt;a title="X.509 PKI Digital Certificates" href="http://www.ietf.org/html.charters/pkix-charter.html" target=_blank&gt;&lt;/a&gt;&lt;a href="http://www.ietf.org/html.charters/pkix-charter.html" target="_blank"&gt;X.509
PKI Digital Certificates&lt;/a&gt;&gt; are being transmiited during SOAP Message exchanges
for both &lt;a title=XML-Encryption href="http://www.w3.org/TR/xmlenc-core/" target=_blank&gt;XML-Encryption&lt;/a&gt; and &lt;a title="XML-Digital Signature" href="http://www.w3.org/TR/xmldsig-core/" target=_blank&gt;XML-Digital
Signature&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
There seems to be some sort of slight confusion here so I will explain in a more user-friendly
fashion here.
&lt;/p&gt;
&lt;p&gt;
Although &lt;a title=XML-Encryption href="http://www.w3.org/TR/xmlenc-core/" target=_blank&gt;XML-Encryption&lt;/a&gt; and &lt;a title="XML-Digital Signature" href="http://www.w3.org/TR/xmldsig-core/" target=_blank&gt;XML-Digital
Signature&lt;/a&gt; works on the same fundamental principles, they are implemented rather
differently. I will not go into details on how they work on top of Factoring, Prime
Numbers and such as these are topics that will not fit into one blog post. You may
want to go &lt;a href="http://www.fact-index.com/p/pu/public_key_cryptography.html" target=_blank&gt;here&lt;/a&gt; to
find out more. To put it simply:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
If Alice wants to encrypt a message just for Bob, Alice will encrypt the message using
Bob's (Publicly-available)&amp;nbsp;Public Key, which, Bob's (Secretly-held) Private Key
can decrypt once he received the message 
&lt;li&gt;
If Alice wants to sign a message, Alice will encrypt the message using her (Secretly-held)
Private Key and then anyone with Alice's (Publicly-available) Public Key will be able
to verfy that the message was authentic and signed by Alice only.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
If you scrutinize these 2 key principles enough, you will realize that there is a
key differing implementation detail.
&lt;/p&gt;
&lt;p&gt;
Now, lets go into how WSE 2.0 implements&amp;nbsp;&lt;a title="WS-Security Specifications" href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf" target=_blank&gt;&lt;/a&gt;OASIS
WS-Security Specifications&gt; riding on top of ASMX XML Web Services.
&lt;/p&gt;
&lt;p&gt;
To be true to myself and how I would try to use the term &lt;a href="http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/07/25/20245.aspx" target=_blank&gt;XML
Services&lt;/a&gt; whenever I can, I would also avoid the use of client-server whenever
I can and use the term Publisher-Subscriber instead.
&lt;/p&gt;
&lt;p&gt;
For simplicity's sake, I assume the following:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
[PublisherCode] is always going to return "Hello World" 
&lt;li&gt;
[PublisherCode] Response Stream is just going to be plain simple vanilla message with
NO fat and trimmings 
&lt;li&gt;
ONLY X509 Asymmetric Encryption Public Private Key Pairs are used here 
&lt;li&gt;
Alice is the Subscriber while Bob plays the role of the Publisher&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;For Scenario 1 XML-Encryption&lt;/strong&gt; 
&lt;hr id=null&gt;
&lt;strong&gt;[PublisherCode]&lt;/strong&gt;&lt;font face=Georgia color=#0000ff size=2&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;WebMethod()&amp;gt;
_&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; HelloWorld() &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;String&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Hello
World"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/em&gt;&lt;/font&gt; 
&lt;p&gt;
&lt;strong&gt;[SubscriberCode]&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; a &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; IndexWse &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; IndexWse&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; store &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; X509CertificateStore &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; _&lt;br&gt;
X509CertificateStore.CurrentUserStore(X509CertificateStore.OtherPeople)&lt;br&gt;
store.OpenRead()&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; cert &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; X509Certificate &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; store.FindCertificateByKeyIdentifier
_&lt;br&gt;
(Convert.FromBase64String(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"bBwPfItvKp3b6TNDq+14qs58VJQ="&lt;/span&gt;))(0)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; xTok &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; X509SecurityToken(cert)&lt;br&gt;
&lt;br&gt;
a.RequestSoapContext.Security.Elements.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; EncryptedData(xTok))&lt;br&gt;
&lt;br&gt;
MessageBox.Show(a.HelloWorld)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Resultant Request SOAP Message in brief]&lt;/strong&gt;
&lt;br&gt;
...&lt;br&gt;
&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;&amp;nbsp; &amp;lt;xenc:EncryptedKey xmlns:xenc="&lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.w3.org/2001/04/xmlenc"&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;http://www.w3.org/2001/04/xmlenc&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;#"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xenc:EncryptionMethod Algorithm="&lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.w3.org/2001/04/xmlenc#rsa-1_5"&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;http://www.w3.org/2001/04/xmlenc#rsa-1_5&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;KeyInfo xmlns="&lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig"&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;http://www.w3.org/2000/09/xmldsig&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;#"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;wsse:KeyIdentifier ValueType="&lt;/em&gt;&lt;/font&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509"&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;&amp;nbsp; &lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;SubjectKeyIdentifier"&amp;gt;bBwPfItvKp3b6TNDq+14qs58VJQ=&amp;lt;/wsse:KeyIdentifier&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/KeyInfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xenc:CipherData&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xenc:CipherValue&amp;gt;XFMDuiWzvjOVA9k&lt;/em&gt;&lt;/font&gt;&lt;font face=Georgia color=#000080 size=2&gt;&lt;em&gt;FThrkUo=&amp;lt;/xenc:CipherValue&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/xenc:CipherData&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xenc:ReferenceList&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xenc:DataReference URI="#EncryptedContent-e8284f45-0a66-409d-a5e2-c041b648fbac"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/xenc:ReferenceList&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xenc:EncryptedKey&amp;gt;&lt;br&gt;
...&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Comments]&lt;/strong&gt;
&lt;br&gt;
Since Alice is encrypting something specific for Bob's eyes only, Alice need to explicity
get Bob's (Publicly-available) Public Key. This has to be an explicit assumption to
make. This can be done in many ways which traditionally make take some out-of-band
approach. In our case above, Bob's Public Key is installed on my machine in the CurrentUserStore\OtherPeople
key store. Bob can then use his (Secretly-held) Private Key to decrypt the cipher
in the message. This is a very end-user specific approach. It is unlikely Alice will
be encrypting something that she wants the whole world to see. Therefore, the Publisher
(Bob) can be sure that the X509 SubjectKeyIdentifier of "bBwPfItvKp3b6TNDq+14qs58VJQ=",
which contains his (Secretly-held) Private Key, can be found in his key store of the
machine. It would be a fairly safe assumption to make.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;For Scenario (2) XML-Digital Signature&lt;/strong&gt; 
&lt;hr id=null&gt;
&lt;strong&gt;[PublisherCode]&lt;/strong&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;WebMethod()&amp;gt;
_&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; HelloWorld() &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;String&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Hello
World"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[SubscriberCode]&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; a &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; IndexWse &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; IndexWse&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; store &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; X509CertificateStore &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; _&lt;br&gt;
X509CertificateStore.CurrentUserStore(X509CertificateStore.MyStore)&lt;br&gt;
store.OpenRead()&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; cert &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; X509Certificate &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; store.FindCertificateByKeyIdentifier
_&lt;br&gt;
(Convert.FromBase64String(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"gBfo0147lM6cKnTbbMSuMVvmFY4="&lt;/span&gt;))(0)&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; xTok &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; X509SecurityToken(cert)&lt;br&gt;
&lt;br&gt;
a.RequestSoapContext.Security.Tokens.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(xTok)&lt;br&gt;
a.RequestSoapContext.Security.Elements.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;New&lt;/span&gt; MessageSignature(xTok))&lt;br&gt;
&lt;br&gt;
MessageBox.Show(a.HelloWorld)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Resultant Request SOAP Message in brief]&lt;/strong&gt;
&lt;br&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;...&lt;br&gt;
&amp;nbsp; &amp;lt;wsse:BinarySecurityToken ValueType="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;EncodingType="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;wsu:Id="SecurityToken-7b5d8096-928a-45d2-b504-d0bfb84eab41"&amp;gt;MIIBxDCCAW6gAwIBAgIQxU&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;PYdu2fPMER8ajJfl&amp;lt;/wsse:BinarySecurityToken&amp;gt;&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp; &amp;lt;Signature xmlns="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://www.w3.org/2000/09/xmldsig&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;#"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;SignedInfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;CanonicalizationMethod Algorithm="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.w3.org/2001/10/xml-exc-c14n"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://www.w3.org/2001/10/xml-exc-c14n&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;#"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;SignatureMethod Algorithm="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://www.w3.org/2000/09/xmldsig#rsa-sha1&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;Reference URI="#Id-f7e1c0fa-e3da-4cb4-be53-f583153bc588"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Transforms&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Transform Algorithm="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.w3.org/2001/10/xml-exc-c14n"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://www.w3.org/2001/10/xml-exc-c14n&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;#"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/Transforms&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;DigestMethod Algorithm="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.w3.org/2000/09/xmldsig#sha1"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://www.w3.org/2000/09/xmldsig#sha1&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;DigestValue&amp;gt;avMezj5NhZwNerXidi5oBmjqi/g=&amp;lt;/DigestValue&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/Reference&amp;gt;&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; &amp;lt;/SignedInfo&amp;gt;&lt;br&gt;
&amp;nbsp; &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;&amp;lt;SignatureValue&amp;gt;JfnqZeDHboWDI2n2gW&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;=&amp;lt;/SignatureValue&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;KeyInfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;wsse:Reference URI="#SecurityToken-7b5d8096-928a-45d2-b504-d0bfb84eab41" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;ValueType="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;"
/&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;/wsse:SecurityTokenReference&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/KeyInfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/Signature&amp;gt;&lt;br&gt;
...&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Comments]&lt;br&gt;
&lt;/strong&gt;If you look closely at the subscriber code, you will notice a few differences.
First, Alice is using her (Secretly-held) Private Key to sign the message. Then she
attaches the X509 Digital Certificate to the message. WSE2.0 is smart enough to know
that ONLY the Public-Key pair of the X509 Digital Certificate goes out in SOAP on
the wire. This is encapsulated in the &amp;lt;wsse:BinarySecurityToken&amp;gt; element in
the SOAP Header. Why the difference ? Because a signed message by Alice is for any
and everyone to verify and therefore Alice cannot assume that any and everyone has
got a copy of her Public Key. In this case, she has to attach her Public Key in the
X509 Cert to her SOAP Request Message so that anyone getting hold of her Public-Key
can verify that ONLY she (Alice) can sign the message. The &amp;lt;wsse:BinarySecurityToken&amp;gt;
element, in this case, actually contains a Base64 Binary Respresentation of Alice's
Public Key X509 Certificate.
&lt;/p&gt;
&lt;p align=center&gt;
&lt;font face=Verdana color=#ff0000&gt;&lt;strong&gt;Now, can you spot the hack here ?&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
If Mallet of Man-In-The-Middle chances upon this message, he can actually signed the
SOAP Message elements with his (Secretly-held) Private Key. Then he can replaced Alice's
&amp;lt;wsse:BinarySecurityToken&amp;gt; element with his own Base64 Binary Respresentation
of Mallet's Public Key X509 Certificate. If Mallet succeeds in doing so, and this
can be fairly straightforward and easy to implement (I may blog about how to do this
in a later post), the SOAP Message received is actually cryptographically verified
to be accurate even though the trust has failed because of the Untrusted Public Key.
&lt;/p&gt;
&lt;p&gt;
So, what can Bob do ? Well, Bob has got 2 choices BUT both require some out-of-band
communication with Alice. There has to be some kind of communication work done before
trust can actually be established. You really cannot run away from it.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;1)&lt;/strong&gt; &lt;strong&gt;Bob can implement a Trust Verification at the Application
Layer&lt;/strong&gt; 
&lt;hr id=null&gt;
&lt;strong&gt;[PublisherCode]&lt;/strong&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;WebMethod()&amp;gt;
_&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; HelloWorld() &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;String&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; xtok &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; X509SecurityToken &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; GetSigningToken(RequestSoapContext.Current)&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;If&lt;/span&gt; xtok.Certificate.GetCertHashString &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; RetrieveFromListofTrustedThumbPrints&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;OR&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;If&lt;/span&gt; xtok.KeyIdentifier.Value &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; RetrieveFromListofTrustedKeyIdentifiers&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Hello
World"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Shared&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; GetSigningToken(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ByVal&lt;/span&gt; context &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; SoapContext) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; SecurityToken&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; element &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; ISecurityElement&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;For&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Each&lt;/span&gt; element &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;In&lt;/span&gt; context.Security.Elements&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;If&lt;/span&gt; (&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TypeOf&lt;/span&gt; (element) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Is&lt;/span&gt; MessageSignature) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Then&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'
The context contains a Signature element. &lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Dim&lt;/span&gt; sign &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; MessageSignature &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; element&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'
The SOAP body is signed&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; sign.SigningToken&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;If&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Next&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Nothing&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'
GetSigningToken&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Comments]&lt;/strong&gt;
&lt;br&gt;
As you can see, the message is allowed through and Bob checks it at the application
level. He can either verify via the Digital Certificate's Thumbprint which is exposed
via the GetCertHashString property or the Digital Certificate's KeyIdentifier which,
in this case, happens to be "gBfo0147lM6cKnTbbMSuMVvmFY4=" One drawback on this method
is that message is allowed through to the application layer and certain resources
are invoked to check for the trust of the sender.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;2) Bob can implement a Trust Verification at the WS-Policy Level 
&lt;hr id=null&gt;
[PublisherCode]&lt;/strong&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;WebMethod()&amp;gt;
_&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt; HelloWorld() &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;String&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Return&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Hello
World"&lt;/span&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;End&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[WS-Policy File in brief]&lt;/strong&gt;
&lt;br&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;...&lt;br&gt;
&amp;nbsp; &amp;lt;request policy="#Sign-X.509" /&amp;gt;&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&amp;nbsp; &amp;lt;policies xmlns:wsu="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;xmlns:wsp="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://schemas.xmlsoap.org/ws/2002/12/policy"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://schemas.xmlsoap.org/ws/2002/12/policy&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;"
xmlns:wssp="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://schemas.xmlsoap.org/ws/2002/12/secext"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://schemas.xmlsoap.org/ws/2002/12/secext&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;xmlns:wse="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://schemas.microsoft.com/wse/2003/06/Policy"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://schemas.microsoft.com/wse/2003/06/Policy&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;xmlns:wsse="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;" &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;xmlns:wsa="&lt;/font&gt;&lt;/em&gt;&lt;a href="http://schemas.xmlsoap.org/ws/2004/03/addressing"&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;http://schemas.xmlsoap.org/ws/2004/03/addressing&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wsp:Policy wsu:Id="Sign-X.509"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:Integrity wsp:Usage="wsp:Required"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:TokenInfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:SecurityToken wse:IdentityToken="true"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;font face=Georgia color=#000080 size=2&gt;&amp;lt;wssp:TokenType&amp;gt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&amp;lt;/wssp:TokenType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:TokenIssuer&amp;gt;CN=Root Agency&amp;lt;/wssp:TokenIssuer&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:Claims&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:SubjectName MatchType="wssp:Exact"&amp;gt;CN=WSE2QuickStartClient&amp;lt;/wssp:SubjectName&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;wssp:X509Extension OID="2.5.29.14" MatchType="wssp:Exact"&amp;gt;gBfo0147lM6cKnTbbMSuMVvmFY4=&amp;lt;/wssp:X509Extension&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/wssp:Claims&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/wssp:SecurityToken&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/wssp:TokenInfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/wsp:Policy&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/policies&amp;gt;&lt;br&gt;
...&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;[Comments]&lt;/strong&gt;
&lt;br&gt;
As you can see, this method is so much cleaner and neater. Messages will fail at the
Policy Pipleine level and will NOT reach Bob's application code itself. See that the
HelloWorld WebMethod has no extra trimmings and fat. The policy file dictates that
the X509 Digital Certificate coming in must have SubjectName = CN=WSE2QuickStartClient
AND KeyIdentifier = gBfo0147lM6cKnTbbMSuMVvmFY4=
&lt;/p&gt;
&lt;p&gt;
If the SOAP Requests carrying the &amp;lt;wsse:BinarySecurityToken&amp;gt; element doesnt
meet these policy demands, an exception is thrown. Beautiful ! Of course, technically
speaking, resources are still being invoked to check for these demands but they happen
at the policy-assertion level of the WSE pipelines which are abstracted away from
the developer, thus allowing these developers to focus on the business logic itself.
Application code is definitely cleaner and more maintainable.
&lt;/p&gt;
&lt;p&gt;
Both methods, though slightly different, work on a major principle of assumption that
Alice and Bob have established some kind of communication channel between them or
amongst others where Trusted KeyIdentifiers or Thumbprints are exchanged. It also
highlights the fact on how important having a common trusted root Cert Authority that
can be verifiable such as Verisign or Checkpoint is.
&lt;/p&gt;
&lt;p&gt;
This blog post, long as it is, highlights some major points. We dont live in a secure
world and this is the only thing we can assume safely. Verifying a signed message
is NOT as simple as it may seem. There has to be some kind of out-of-band approach
to ascertain trust between partners because validation of the message, as we can see
from the above example, is definitely NOT enough.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=371862d9-5622-4bc7-a6d6-5581b9eea12e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=57c327f0-05eb-455c-827c-25bd748634ff</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,57c327f0-05eb-455c-827c-25bd748634ff.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Some of the <a href="http://www.w3.org/TR/soap/" target="_blank">(W3C) SOAP</a> specifications
that relates to the implementation and optimizing of the transmission and/or
wire format of SOAP messages, namely
</p>
        <ul>
          <li>
            <a href="http://www.w3.org/TR/2004/PR-xop10-20041116/" target="_blank">XOP</a>
          </li>
          <li>
            <a href="http://www.w3.org/TR/2004/PR-soap12-mtom-20041116/" target="_blank">MTOM</a>
          </li>
          <li>
            <a href="http://www.w3.org/TR/2004/PR-soap12-rep-20041116/" target="_blank">RRSHB</a>
          </li>
        </ul>
        <p>
have reached the Proposed Recommendation Stage of W3C.
</p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=57c327f0-05eb-455c-827c-25bd748634ff" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>More specifications of SOAP reached Proposed Recommendation Stage of W3C</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,57c327f0-05eb-455c-827c-25bd748634ff.aspx</guid>
      <link>http://www.softwaremaker.net/blog/MoreSpecificationsOfSOAPReachedProposedRecommendationStageOfW3C.aspx</link>
      <pubDate>Tue, 16 Nov 2004 22:12:28 GMT</pubDate>
      <description>&lt;p&gt;
Some of the&amp;nbsp;&lt;a href="http://www.w3.org/TR/soap/" target="_blank"&gt;(W3C) SOAP&lt;/a&gt; specifications
that relates to the implementation&amp;nbsp;and optimizing of the transmission and/or
wire format of SOAP messages, namely
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.w3.org/TR/2004/PR-xop10-20041116/" target=_blank&gt;XOP&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.w3.org/TR/2004/PR-soap12-mtom-20041116/" target=_blank&gt;MTOM&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://www.w3.org/TR/2004/PR-soap12-rep-20041116/" target=_blank&gt;RRSHB&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
have reached the Proposed Recommendation Stage of W3C.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=57c327f0-05eb-455c-827c-25bd748634ff" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>WS-Splat Specs;XML Services</category>
    </item>
    <item>
      <trackback:ping>http://www.softwaremaker.net/blog/Trackback.aspx?guid=6c4f2b61-8404-4026-bdf9-d2a0a36fda24</trackback:ping>
      <pingback:server>http://www.softwaremaker.net/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.softwaremaker.net/blog/PermaLink,guid,6c4f2b61-8404-4026-bdf9-d2a0a36fda24.aspx</pingback:target>
      <dc:creator>William Tay</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://dotnetjunkies.com/WebLog/softwaremaker/category/1372.aspx" target="_blank">My
previous blogs on WS-* Specs</a>
        </p>
        <img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=6c4f2b61-8404-4026-bdf9-d2a0a36fda24" />
        <br />
        <hr />
© William Tay 2012 | Swinging Technologist 
<br /><a href="http://www.softwaremaker.net/blog">http://www.softwaremaker.net/blog</a></body>
      <title>Previously, on Softwaremaker - WS-* Specs</title>
      <guid isPermaLink="false">http://www.softwaremaker.net/blog/PermaLink,guid,6c4f2b61-8404-4026-bdf9-d2a0a36fda24.aspx</guid>
      <link>http://www.softwaremaker.net/blog/PreviouslyOnSoftwaremakerWSSpecs.aspx</link>
      <pubDate>Fri, 29 Oct 2004 15:01:10 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://dotnetjunkies.com/WebLog/softwaremaker/category/1372.aspx" target=_blank&gt;My
previous blogs on WS-* Specs&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.softwaremaker.net/blog/aggbug.ashx?id=6c4f2b61-8404-4026-bdf9-d2a0a36fda24" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
© William Tay 2012 | Swinging Technologist 
&lt;br /&gt;
&lt;a href="http://www.softwaremaker.net/blog"&gt;http://www.softwaremaker.net/blog&lt;/a&gt;</description>
      <category>Web Services Enhancements (WSE);WS-Splat Specs</category>
    </item>
  </channel>
</rss>