TSA in iText is oriented to be used inside an external signature with signed 
attributes to also support OCSP. The main objective was to make it work, now 
we'll have to improve on the details.

Paulo

> -----Original Message-----
> From: Bert Vingerhoets [mailto:[email protected]] 
> Sent: Thursday, July 02, 2009 12:01 PM
> To: [email protected]
> Subject: [iText-questions] TSA in iText 2.1.6
> 
> Hi,
> 
> I was checking out the new functionality of iText 2.1.6, 
> especially the added TSA support.
> 
> In absence of documentation or examples, I took a look at the 
> code to determine how to use the timestamping functionality. 
> However, all I could find about the subject were the 
> interface TSAClient and class TSAClientBouncyCastle. Neither 
> of which are instantiated anywhere, the only references of 
> TSAClient I could find were in one PdfPKCS7#getEncodedPKCS7 
> method that isn't used by the rest of iText (except for 
> filling the TSAClient argument with null).
> 
> When following the examples for PDF signing using external 
> signatures, one of the getEncodedPKCS7() methods does get 
> called outside of iText (for setting the CONTENTS key in the 
> dictionary passed to the final PdfSignatureAppearance#close() 
> invocation). However, When I replace this getEncodedPKCS7() 
> call by the overload that accepts a TSAClient, the resulting 
> array is too large to fit in the allocated buffer.
> Checking where this buffer gets allocated leads to an 
> internal invocation of getEncodedPKCS7() (without TSAClient argument).
> 
> As far as I can see, being able to use TSA in iText requires 
> me to patch the library (luckily we're using the MPL license) 
> or try to externalize the entire contents of the 'if 
> (cryptoDictionary == null)'-branch from 
> PdfSignatureAppearance#preClose() where the CONTENTS buffer 
> is allocated with the first call (through 
> sigStandard.setSignInfo) to getEncodedPKCS7.
> Patching iText to allow specifying a TSAClient externally 
> seems the easiest option to me.
> 
> Is this correct? Or is there another way to use TSA in iText?
> 
> 
> On a brighter note, once I hacked the library to effectively 
> use a TSAClient, a correct PDF was indeed produced and 
> recognized by Acrobat Reader; so the code does, in fact, work.
> 
> 
> Regards,
> 
> Bert Vingerhoets - Research & Development
> Inventive Designers NV
> 
> Phone: +32 3 821 01 70
> Fax: +32 3 821 01 71
> Email: Bert_Vingerhoets at inventivegroup dot com
> http://www.inventivegroup.com/
> 
> 
> Inventive Designers' Email Disclaimer:
> http://www.inventivedesigners.com/email-disclaimer


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to