iText doesn't support signing certified docs.
Paulo
> -----Original Message-----
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of Khurram Salim
> Sent: Wednesday, July 19, 2006 11:16 AM
> To: itext-questions@(protected)
> Subject: [iText-questions] I found some problems regarding
> certified PDFdocuments using iText 1.4.2
>
> Hi everybody!
>
> I have some problems regarding the Certified PDf document
> signing. Please see below steps and let me know that if I'm
> doing anything wrong.
>
> Steps:
> ====
> 1 - I have created an empty signature in PDF document.
> 2 - I have certified the document by creating a digital signature.
> 3 - I sign the existing empty signature.
> 4 - The previous signature got corrupted or PDf document got
> corrupted.
> 5 - Please see below sample code as well as some supported
> PDF documents.
>
> Sample code:
> =========
>
> //Signing Empty Signature
> //Getting Source PDF
> obj_srcFile = new File("Second.pdf");
>
> //Reading PDF File
> m_objPDFIn = new PdfReader("Second.pdf");
>
> //Getting Page Total Page Nos of PDF
> i_totalpageno = m_objPDFIn.getNumberOfPages();
>
> //Getting Empty Signatures
> AcroFields obj_emptysig = m_objPDFIn.getAcroFields();
>
> //Storing Signature Names
> ArrayList obj_signames = obj_emptysig.getSignatureNames();
>
> //Creating Array of Signamture Names
> Object[] obj_emptysigname = obj_signames.toArray();
>
> //No. of of Signatures
> int i_noofsig = obj_emptysigname.length;
>
> //Name of Signed File [Signed File Loaded]
> m_objfos = new FileOutputStream("EmptyFilled.pdf");
>
> //Creating Signature
> m_objPDFStamp = PdfStamper.createSignature(m_objPDFIn,
> m_objfos, '\0', null, true);
>
> //Getting Signature Appearance
> m_objSigApp = m_objPDFStamp.getSignatureAppearance();
> //Setting Signature / Signing Parameters
> m_objSigApp.setCrypto(m_objPrk, m_objCertChain,null,
> PdfSignatureAppearance.WINCER_SIGNED);
>
> //Setting Signing Reason
> m_objSigApp.setReason("I'm Auhtor of this document");
>
> //Setting Contact Detail
> m_objSigApp.setContact("Testing Testing, Testing Testing
> Testing ");
>
> //Loading Signature Image in Signature Appearance
> m_objSigApp.setImage(obj_pic);
>
> //Setting Location
> m_objSigApp.setLocation("Testing Testing ");
>
>
> //Setting Empty Signature
> m_objSigApp.setVisibleSignature("Signature1");
>
> //Setting Empty Signature
> //m_objSigApp.setVisibleSignature("Signature2");
>
> //Closing PdfStamper
> m_objPDFStamp.close();
>
> System.out.println("PDF Document is Signed...[Empty Signature]");
>
> //Closing OS
> m_objfos.close();
>
>
> Regards,
>
> Khurram Saleem
>
> ________________________________
>
> How low will we go? Check out Yahoo! Messenger's low
> PC-to-Phone call rates.
> <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.r
> d.yahoo.com/evt=39663/*http://voice.yahoo.com>
>
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.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions