Skip to main content
Previous sectionNext section

Specifying the Digest Method

Specifying the Digest Method

By default, the digest value for the signature is computed via the SHA-1 algorithm, and the <Signature> element in the security header includes something like this:

   <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
   <DigestValue>waSMFeYMruQn9XHx85HqunhMGIA=</DigestValue>
Copy code to clipboard

You can specify a different digest method for the signature. To do so, call the SetDigestMethod() method of your instance of %XML.Security.Signature. For the argument, use one of the following macros (which are contained in the %soap.inc file):

  • $$$SOAPWSsha1 (the default)

  • $$$SOAPWSsha256

  • $$$SOAPWSsha384

  • $$$SOAPWSsha512

For example:

 do sig.SetDigestMethod($$$SOAPWSsha256)
Copy code to clipboard