Following an old post I tried to do something I read, i need to get the
Signature object from a signed PDF and get the ByteRange and hashing
algorithm.

Following the next brief extgract of code, you can view I can get the
signing certificate Issuer Info, BUT if I try to get tha algorith I get a
NULL error... why?

AcroFields af=pdf.getAcroFields();
ArrayList names=af.getSignatureNames();
String name;
KeyStore ks=PdfPKCS7.loadCacertsKeyStore();
for(Iterator it=names.iterator(); it.hasNext();) {
  name=(String)it.next();
  PdfPKCS7 pk=af.verifySignature(name);
 
System.out.println("getSubject:"+PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));
<--OK
  PdfDictionary pdf_dict=af.getSignatureDictionary(name);

BUT if try pk.getSigningCertificate().getSigAlgName() I get a NULL object.

And after that if I continue the code with:
PdfDictionary pdf_dict=af.getSignatureDictionary(name);
Set s=pdf_dict.getKeys();
System.out.println("keys set:"+s.toString()); <- I get "[/Type, /Filter,
/Contents, /M, /Name, /SubFilter, /ByteRange, /Prop_Build]"
But if I try to access the values form these keys they are alll null too (I
wanted to readf here the byte range)

My goal is to have the hash algorithm used and the bytes used to compute the
sign.

Best regards.
J.G

-- 
View this message in context: 
http://www.nabble.com/Getting-hash-and-byte-range-from-a-signature-tp25766668p25766668.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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