The signature code is being revised, the existing code can be confusing. I'm still not sure what the end result will be be the general idea is to have a simple, no questions asked, way of signing and an external signature way of signing where signature dictionaries can be created to fit other needs. This will break existing code but now that iText 5 is fresh is the right time to do it.
Paulo > -----Original Message----- > From: dahepe [mailto:[email protected]] > Sent: Tuesday, December 22, 2009 10:33 AM > To: [email protected] > Subject: [iText-questions] How to sign examples > > Hi, > > playing around with digital signing using iText I stumbled > across the "How to sign ..." > <http://itextpdf.sourceforge.net/howtosign.html> examples. > > Especially the examples using external signatures left some > questions open - at least for me. For example the setCrypto > method on the PdfSignatureAppearance object is always called > with the private key object: > ... > sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED); > ... > As one uses an external signature the private key should be > of no meaning for the PdfSignatureAppearance object and > providing the key should not be necessary - or am I wrong? > > Additionally I kind of struggle with the the > setExternalDigest calls on the PdfSignatureAppearance object > ... > sap.setExternalDigest(new byte[128], new byte[20], "RSA"); > ... > The calls seem to be necessary to initialize internal > structures in the PdfSignatureAppearance > (NullPointerException when omitting the private key and these > calls...). But where do the sizes of the two arrays come from > and how do I know the correct size to use? I image that there > is some relation between the size of these arrays an the used > key(algorithm) but what is this relation? > > Best regards, > Daniel. 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.
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ 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/
