This week code will be posted that will fix this and add timestamp and ocsp 
signing and verifying. It may be easier to wait a couple of days.

Paulo 

> -----Original Message-----
> From: mkl [mailto:[email protected]] 
> Sent: Tuesday, June 02, 2009 9:15 AM
> To: [email protected]
> Subject: Re: [iText-questions] Verifying signature!! 
> NoSuchAlgorithmException: 1.2.840.113549.1.1.1
> 
> 
> Robert,
> 
> please reply to the list.
> 
> 
> RobertQ wrote:
> > 
> > How are you? You repplied my post "Verifying signature!!
> > NoSuchAlgorithmException: 1.2.840.113549.1.1.1" suggesting me this:
> > 
> > mkl wrote:
> >> 
> >> Use the AcroFields methods getSignatureNames and 
> getSignatureDictionary.
> >> The latter dictionary contains the signature container (key:
> >> PdfName.CONTENTS, apply getOriginalBytes) and the range data (key:
> >> PdfName.BYTERANGE). Use something like the class
> >> PdfSignatureAppearance.RangeStream to extract the signed data.
> >> 
> > 
> > What I tryied to do is the following: 
> > 
> >         PdfReader reader = new PdfReader(new
> > RandomAccessFileOrArray("temp.pdf"), null);
> >         AcroFields acrFs = reader.getAcroFields();
> > 
> >         PdfDictionary dic = 
> acrFs.getSignatureDictionary("Signature1");
> > 
> >         PdfObject sigContainer = dic.get(PdfName.CONTENTS);
> >         PdfObject rangeData = dic.get(PdfName.BYTERANGE);
> > 
> > But it didn't work out, I stopped at this point.
> > Can you send me an example code of what you suggested.
> > 
> 
> What exactly didn't work out?
> 
> Obviously you have to inspect the individual attributes more 
> thoroughly,
> e.g.:
> 
> ((PdfString)PdfReader.getPdfObject(dic.get(PdfName.CONTENTS)))
> .getOriginalBytes()
> contains the signature container and some trailing debris, 
> most often filled
> with 0 bytes.
> (PdfArray)PdfReader.getPdfObject(dic.get(PdfName.BYTERANGE)) 
> will give you
> the byterange array; you might want to use this array in 
> concert with a
> class like PdfSignatureAppearance.RangeStream to extract the 
> signed data
> stream.
> 
> And obviously you should do some sanity checks (e.g. for null 
> values) in
> production code...
> 
> Regards,   Mikel.


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.


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
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