title: Validating a Signature of a SOAP Message
body: <p>Everybody, Hello!</p>
  
  <p>This is my request message:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Header&gt;
    &lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="1"&gt;
       &lt;wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-A3BCFAE87E12A8813813289737654441"&gt;MIICCTCCAXKgAwIBAgIETzVFkDANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJSVTEKMAgGA1UECBMBMTEKMAgGA1UEBxMBMTEKMAgGA1UEChMBMTEKMAgGA1UECxMBMTEKMAgGA1UEAxMBMTAeFw0xMjAyMTAxNjI4MDBaFw0xMjA1MTAxNjI4MDBaMEkxCzAJBgNVBAYTAlJVMQowCAYDVQQIEwExMQowCAYDVQQHEwExMQowCAYDVQQKEwExMQowCAYDVQQLEwExMQowCAYDVQQDEwExMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdwxyRNYlWADnTtzH9/s/ehhD2iFzvF2xI+tBNyhbBb98EQNiIFdEegwGPhtd3Cfe1lQqtddWdFX2uLqozMAgd1KzSEuH9lI5DPiir3RfVdy+Irs5ZYiD/H4/DcUMUNyVcWspf9oG25wNdwNHKY8Aqz2269uYMCCoIBuWt6POwFQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAGLgTXbn7h2rBjv++6OopDooRifc4e2k+9sSTpLNegs9OvQzR8DpmQ/6Vt0RFprIdXSv+IVMcmL8Q2dmI9v0R61NIhdEjzSVbO2+PF9h1ShUARzMawRC/EOdjwVjDsk1WMxF18+wvH9SQxBSK3H2WpJbDWBxZCOW5CK1N6AKKJiC&lt;/wsse:BinarySecurityToken&gt;
       &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-2"&gt;
          &lt;ds:SignedInfo&gt;
             &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
                &lt;ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap" /&gt;
             &lt;/ds:CanonicalizationMethod&gt;
             &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&gt;
             &lt;ds:Reference URI="#id-1"&gt;
                &lt;ds:Transforms&gt;
                   &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
                      &lt;ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="" /&gt;
                   &lt;/ds:Transform&gt;
                &lt;/ds:Transforms&gt;
                &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&gt;
                &lt;ds:DigestValue&gt;RJhc1ZVjXdUQEIwLTH356p7H0QY=&lt;/ds:DigestValue&gt;
             &lt;/ds:Reference&gt;
          &lt;/ds:SignedInfo&gt;
          &lt;ds:SignatureValue&gt;F0q0NV7kaSbAcsLHxVpYD1bQ1RAJcw6wPapDKAM9PIcs7EuS9S5PlE4cQMfAp1WgsKa91r3op1OQ5UrYmmdj/UneYawdPIYSaoFBGjndTXZnOCKp4YfRTQGZ2EVJRFHJbPsTsqHedPAyJLHhciViguTGeuA0hZAQN97KB/9ZLmY=&lt;/ds:SignatureValue&gt;
          &lt;ds:KeyInfo Id="KI-A3BCFAE87E12A8813813289737654452"&gt;
             &lt;wsse:SecurityTokenReference wsu:Id="STR-A3BCFAE87E12A8813813289737654483"&gt;
                &lt;wsse:Reference URI="#X509-A3BCFAE87E12A8813813289737654441" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" /&gt;
             &lt;/wsse:SecurityTokenReference&gt;
          &lt;/ds:KeyInfo&gt;
       &lt;/ds:Signature&gt;
    &lt;/wsse:Security&gt;
  &lt;/soap:Header&gt;
   &lt;soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-1"&gt;
    &lt;stubMethod xmlns="http://ws_base.ws.stuff/" /&gt;
   &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I try to validate the <code>&lt;ds:DigestValue&gt;RJhc1ZVjXdUQEIwLTH356p7H0QY=&lt;/ds:DigestValue&gt;</code> which is related to the body tag. There are tags like <code>ds:CanonicalizationMethod</code> and <code>ds:Transforms</code>which are really confusing for me. My question is how to validate the body part? Firstly, what tag should I get to begin validation</p>
  
  <pre><code>&lt;soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-1"&gt;
    &lt;stubMethod xmlns="http://ws_base.ws.stuff/" /&gt;
   &lt;/soap:Body&gt;
  </code></pre>
  
  <p>or just</p>
  
  <pre><code>&lt;stubMethod xmlns="http://ws_base.ws.stuff/" /&gt; 
  </code></pre>
  
  <p>??? What operations (canonicalization / transformation / encryption) must I perform???</p>
  
  <p>Any help is appreciate. Thanks in advance.</p>