Valentin, Paulo,

Valentin Ivanov wrote
> Could you please take a look at the link i have provided, I am sure you
> took a look at the wrong sample. They are very close, actually one above
> another, and i guess you took a look at the one titled "An example with an
> external hash", but I use the one titled "An example with an external hash
> and signature"! If this sample has error, so do I.

Valentin, I looked at the sample which was immediately visible when I
followed your link: "An example with an external hash". So ok, let's have a
look at the other sample below.

Yes, you are right, that sample does exactly what in my former mail has been
recognized as a bad thing in context with sunpkcs11, it initializes iText
code for signing (which calls Signature.initSign() and, thus, requests a
session) but then supplies an external signature, making iText not use its
Signature instance which, therefore, holds on to its session until GC
releases it.
 
Paulo, maybe PdfPKCS7 should be changed to apply lazy initialization to its
Signature member (at least for signing) --- even in contexts without
sessions, initialization for some private key objects might require relevant
amounts of resources.

And is the injection of the private key really required in this sample? (I
don't use iText signature integration like this; so I do not know if some
other required information is retrieved from the private key even if it is
not used for actual signing.)

Regards,   Michael

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/SunPKC11-Exception-when-signing-PDF-tp4340293p4354129.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to