<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : Detached signature with sha256 digest</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : I need help - I can help : Detached signature with sha256 digest]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 19:39:35 +0000</pubDate>
  <lastBuildDate>Mon, 02 Jan 2017 23:14:21 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=3428</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[Detached signature with sha256 digest : Hi,perhaps here you can learn...]]></title>
   <link>http://www.quickpdf.org/forum/detached-signature-with-sha256-digest_topic3428_post13625.html#13625</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=111">Ingo</a><br /><strong>Subject:</strong> 3428<br /><strong>Posted:</strong> 02 Jan 17 at 11:14PM<br /><br />Hi,<div><br></div><div>perhaps here you can learn more about sha256:</div><div>https://msdn.microsoft.com/de-de/library/system.security.cryptography.sha256cryptoserviceprovider(v=vs.110).aspx</div><div><br></div>]]>
   </description>
   <pubDate>Mon, 02 Jan 2017 23:14:21 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/detached-signature-with-sha256-digest_topic3428_post13625.html#13625</guid>
  </item> 
  <item>
   <title><![CDATA[Detached signature with sha256 digest : Hello, i&amp;#039;m trying to add...]]></title>
   <link>http://www.quickpdf.org/forum/detached-signature-with-sha256-digest_topic3428_post13623.html#13623</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2849">pinozzy</a><br /><strong>Subject:</strong> 3428<br /><strong>Posted:</strong> 02 Jan 17 at 6:00PM<br /><br />Hello, i'm trying to add a visual sha-256 detached signature to my pdf. <br /><br /><br />I did it successfully with this example: http://www.debenu.com/kb/advanced-options-signing-pdf-files/<br /><br />I edited this method  <br /><br />private byte&#091;&#093; SignData(byte&#091;&#093; inputData, X509Certificate2 cert)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create an SHA-1 hash of the file data<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SHA1 sha = new SHA1CryptoServiceProvider();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte&#091;&#093; sha1Result = sha.ComputeHash(inputData);<br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Sign the hash using the certificate<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// This could be changed to use a hardware device (eg. smartcard)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ContentInfo content = new ContentInfo(sha1Result);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SignedCms signedCms = new SignedCms(content);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CmsSigner cmsSigner = new CmsSigner(cert);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;signedCms.ComputeSignature(cmsSigner);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return signedCms.Encode();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />this way: <br /><br /> private byte&#091;&#093; SignData(byte&#091;&#093; inputData, X509Certificate2 cert)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create an SHA-1 hash of the file data<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var sha = new SHA256CryptoServiceProvider();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte&#091;&#093; sha1Result = sha.ComputeHash(inputData);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Sign the hash using the certificate<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// This could be changed to use a hardware device (eg. smartcard)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var oid = new Oid("2.16.840.1.101.3.4.2.1");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var content = new ContentInfo(oid, sha1Result);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var signedCms = new SignedCms(content, true);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var cmsSigner = new CmsSigner(cert);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmsSigner.DigestAlgorithm = oid;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;signedCms.ComputeSignature(cmsSigner);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return signedCms.Encode();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />And i just added this: DPL.SetSignProcessSubFilter(signProcessID, 2);<br /><br />For the detached signature. <br /><br />I got an error from adobe reader, the document signature is visible but with red X and the message of damaged signature.<br /><br />Does anyone have a working example of Detached sha-256 signature? <br /><br />Many thanks all. <br /><br /><br /><br />]]>
   </description>
   <pubDate>Mon, 02 Jan 2017 18:00:59 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/detached-signature-with-sha256-digest_topic3428_post13623.html#13623</guid>
  </item> 
 </channel>
</rss>