Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - Digital Signatures

Output

The output for the setDebugOutput example consists of debug output and non-debug output. The latter is shown in bold letters. The debug output from each Write is displayed between the following lines:

  ===Begin DBStream::Write  (cb=***)
  ===End DBStream::Write  (cb=***)

Notice that <ds:SignedInfo> is thrown out in a different order from the debug output in sign and verify.

The following is the application output.

signature.template.xml has been loaded into an XML DOM


=== Catching digest 1. ===
  ===Begin DBStream::Write  (cb=113)
<ds:Object xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="obj" MimeType="text
/plain">Hello, World!</ds:Object>
  ===End DBStream::Write  (cb=113)
=== Digest 1 caught.===


=== Catching digest 2. ===
  ===Begin DBStream::Write  (cb=339)
<HTML>
<HEAD>
  <TITLE>Example Web Page</TITLE>
</HEAD>
<body>
<p>You have reached this web page by typing &quot;example.com&quot;,
&quot;example.net&quot;,
  or &quot;example.org&quot; into your web browser.</p>
<p>These domain names are reserved for use in documentation and are not
available
  for registration.</p>
</BODY>
</HTML>


  ===End DBStream::Write  (cb=339)
=== Digest 2 caught.===

  ===Begin DBStream::Write  (cb=790)
<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n
-20010315"></ds:CanonicalizationMethod>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"><
/ds:SignatureMethod>
    <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#;Object" URI="#obj">
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:D
igestMethod>
      <ds:DigestValue>8UIaiFvvufk+ybGUHcMk5+2Nmh4=</ds:DigestValue>
    </ds:Reference>
    <ds:Reference URI="http://www.example.com">
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:D
igestMethod>
      <ds:DigestValue>pjaNDnoDLAx4ZBFEXDJ9y6ZT0Ec=</ds:DigestValue>
    </ds:Reference>
  </ds:SignedInfo>
  ===End DBStream::Write  (cb=790)

Data signed.


signature.document.xml has been loaded into an XML DOM

  ===Begin DBStream::Write  (cb=790)
<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n
-20010315"></ds:CanonicalizationMethod>
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"><
/ds:SignatureMethod>
    <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#;Object" URI="#obj">
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:D
igestMethod>
      <ds:DigestValue>8UIaiFvvufk+ybGUHcMk5+2Nmh4=</ds:DigestValue>
    </ds:Reference>
    <ds:Reference URI="http://www.example.com">
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:D
igestMethod>
      <ds:DigestValue>pjaNDnoDLAx4ZBFEXDJ9y6ZT0Ec=</ds:DigestValue>
    </ds:Reference>
  </ds:SignedInfo>
  ===End DBStream::Write  (cb=790)

=== Catching digest 3. ===
  ===Begin DBStream::Write  (cb=113)
<ds:Object xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="obj" MimeType="text
/plain">Hello, World!</ds:Object>
  ===End DBStream::Write  (cb=113)
=== Digest 3 caught.===


=== Catching digest 4. ===
  ===Begin DBStream::Write  (cb=339)
<HTML>
<HEAD>
  <TITLE>Example Web Page</TITLE>
</HEAD>
<body>
<p>You have reached this web page by typing &quot;example.com&quot;,
&quot;example.net&quot;,
  or &quot;example.org&quot; into your web browser.</p>
<p>These domain names are reserved for use in documentation and are not
available
  for registration.</p>
</BODY>
</HTML>


  ===End DBStream::Write  (cb=339)
=== Digest 4 caught.===


Signature verified.