title: SOAP Security Header - Cerificates?
body: <p>SOAP is not one of my friends, so let me please kindly ask for some help.</p>
  
  <p>I have a request to create a SOAP messages to send data to external service.
  It have to be authentificated and signed by certificate.</p>
  
  <p>Bellow is show how it should look like - this is a part of the header - "Security".</p>
  
  <p>Let me please ask - what are all those hashes and were can I get them?
  (they are "highlighted" with ** ** in code)</p>
  
  <p>Many thanks for any reply, much appreciated.</p>
  
  <p>Kind regards</p>
  
  <pre><code>&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"&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-536E4AA6BF962CA97613699845428011"&gt;**MIIE+TCCA+GgAwIBAgIKPs365QAAAAAASjANBgkqhkiG9w0BAQUFADBDMRIwEAYKCZImiZPyLGQBGRYCc2sxFTATBgoJkiaJk/IsZAEZFgVzZmVyYTEWMBQGA1UEAxMNU2ZlcmEgVEVTVCBDQTAeFw0xMjEwMDgwOTM3NTBaFw0xMzEwMDgwOTQ3NTBaMIGSMQswCQYDVQQGEwJTSzERMA8GA1UECBMIU2xvdmFraWExEzARBgNVBAcTCkJyYXRpc2xhdmExFTATBgNVBAoMDHNmw6lyYSwgYS5zLjEMMAoGA1UECwwDw5pWMRgwFgYDVQQDEw9TZmVyYSBURVNUIFVzZXIxHDAaBgkqhkiG9w0BCQEWDWluZm9Ac2ZlcmEuc2swgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMCMcBeOT8b3Wi3ihpThlU9i12lKAcOx3GPkrey1YN2UmT15Um1bctC1eUkDCS8NCsoenwTk5gFNgZjqX+F3+sdPQVUglNo7iU2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CfTLCxzgVPUMDxKWDECKpcaN1XwucVVZvIDWvE/WQ0IipIKZYExmK+f5aUZbJUCxFtFdAsy1yQlkXPZ6vo8nhB+/ocexlQJtmo2kN8K/PdspBw0=**&lt;/wsse:BinarySecurityToken&gt;
     &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-8"&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="wsa ns 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-3"&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="ns" /&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;**lFnegWV52e3LoBj3jNxW84oR5tU=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#id-4"&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="ns" /&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;**Mvnq3Ms+cExBf1pfBeqNJLM+XEk=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#id-5"&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="ns" /&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;**7ktvKkcQQqOm/Uk2cnFg30f9m/A=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#id-6"&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="ns" /&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;**D2SnlCJRWR+F95gdjoK42ZI0D98=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#TS-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="wsse wsa ns soap" /&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;bsXg0RlneSpwynQ6czGW0nZ3tb4=&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#id-7"&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="ns" /&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;**PjApypt2lSmahivJ0oCNKiud4p4=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
           &lt;ds:Reference URI="#UsernameToken-2"&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="wsa ns soap" /&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;**bR63weD24Ab0ddtBIt/RVeGSt1g=**&lt;/ds:DigestValue&gt;
           &lt;/ds:Reference&gt;
        &lt;/ds:SignedInfo&gt;
        &lt;ds:SignatureValue&gt;**idE8pmhmkjY9c6ultBUrXSTukHfvjhiRdvEDViVIROyEgLE3lweNrtAvyLjalxrLJUGQWu63uvqM 9u4TFAi/moY7SeuLsb8Xd86hEAWWPkp061+Kpg5dV+17N8yDOfNx6wG0WQzchHzCzOKaceuqphQN aM92Qg8MVUsond9mkdI=**&lt;/ds:SignatureValue&gt;
        &lt;ds:KeyInfo Id="KI-536E4AA6BF962CA97613699845428202"&gt;
           &lt;wsse:SecurityTokenReference wsu:Id="STR-536E4AA6BF962CA97613699845428213"&gt;
              &lt;wsse:Reference URI="#X509-536E4AA6BF962CA97613699845428011" 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:UsernameToken wsu:Id="UsernameToken-2"&gt;
        &lt;wsse:Username&gt;username&lt;/wsse:Username&gt;
        &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;password&lt;/wsse:Password&gt;
     &lt;/wsse:UsernameToken&gt;
     &lt;wsu:Timestamp wsu:Id="TS-1"&gt;
        &lt;wsu:Created&gt;2013-05-31T07:15:42.305Z&lt;/wsu:Created&gt;
        &lt;wsu:Expires&gt;2013-05-31T10:02:22.305Z&lt;/wsu:Expires&gt;
     &lt;/wsu:Timestamp&gt;
  &lt;/wsse:Security&gt;
  </code></pre>