SignatureHandler.ComputeSignature() is called twice?

59 views
Skip to first unread message

David Černý

unread,
Jun 13, 2013, 8:22:44 PM6/13/13
to pdfne...@googlegroups.com
I have found unexpected behaviour in sample DigitalSignatureTestCS_2010: PKCS7Signature.ComputeSignature() is called twice for each added signature. What is the reason for such behaviour? Is there any way how can I avoid this?

Vincent Ycasas

unread,
Jun 17, 2013, 3:00:14 PM6/17/13
to pdfne...@googlegroups.com
The method is invoked twice because applying the digital signature requires 2 passes. The reason for this is because PDFNet saves the document in one single pass (for effeciency). It is not until the 2nd pass (where all the required bytes for signing are written) which the actual digital signature can be correctly calculated. The 1st call of CreateSignature is necessary to determine the size to allocate for the signature.
Reply all
Reply to author
Forward
0 new messages