Hello all
I have a question regarding the extraction of PKCS#7 signatures from a
signed PDF.
I want to extract to a file, an array of bytes or whatever. How can I do
this having the following code:
*PdfReader reader = null;** ** reader = new PdfReader(signedFile);**
AcroFields af = reader.getAcroFields();** ArrayList names =
af.getSignatureNames();** ** // iterates over the several signatures** for
(int k = 0; k < names.size(); ++k) {** String name = (String)
names.get(k);** PdfPKCS7 pk = af.verifySignature(name);** **
pk.getEncodedPKCS7(); //this would be the method invoked in order to obtain
the PKCS7 byte array** }* However I get a "*java.security.SignatureException:
object not initialized for signing*" because the method above tries to sign
the document, if the variable externalDigest is null.Now, the problem is,
during the pdf reading, this variable is not set, only the *digest* variable
is.
Because I have no way of accessing the *digest* variable I cannot set the *
externalDigest* variable to its value.
Can anybody help me with this?
--
Best regards
Gonçalo Almeida
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
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