I've also tried iText 2.1.2u with Bouncy Castle libraries 1.36 and receive
the same error.

In the end, I could use the iText version 1.5.4 for my needs without having
to use the external Bouncy Catle libraries because all I need to do is
extract the information from the digital signature.  Using 1.5.4 the
following line:

System.out.println("Subject: " +
PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));

works to print out:

Subject: {O=[], OU=[BAH], CN=[Brad Smith], C=[US], E=[BAH]}

But I can't figure out how to extract the individual items from the
certificate in version 1.5.4

Could you help me with this?

It is a simple Adobe self signed digital signature created in Adobe 7.0


Paulo Soares wrote:
> 
> BouncyCastle 1.39 only works with iText 2.1.3 and later.
> 
> Paulo 
> 
>> -----Original Message-----
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On 
>> Behalf Of 021336
>> Sent: Thursday, July 10, 2008 9:20 PM
>> To: [email protected]
>> Subject: [iText-questions] Error when verifying signature
>> 
>> 
>> Using the standard code below:
>> 
>>             PdfReader mReader = new PdfReader(aUnsignedFileName);
>>             AcroFields mForm = mReader.getAcroFields();
>>             ArrayList mSignatures = mForm.getSignatureNames();
>>             String mName;
>>             for (Iterator i = mSignatures.iterator(); i.hasNext();)
>>             {
>>                 mName = (String)i.next();
>>                 System.out.println(mName);
>>                 PdfPKCS7 pk = mForm.verifySignature(mName);
>> 
>> I am getting a Bouncy Castle error when executing "verifySignature"
>> 
>> java.lang.NoSuchMethodError: void
>> org.bouncycastle.asn1.ASN1InputStream.<init>(java.io.InputStream, int)
>> 
>>      at 
>> org.bouncycastle.jce.provider.X509CertParser.readDERCertificat
>> e(Unknown
>> Source)
>> 
>>      at 
>> org.bouncycastle.jce.provider.X509CertParser.engineRead(Unknow
>> n Source)
>> 
>>      at 
>> org.bouncycastle.jce.provider.X509CertParser.engineReadAll(Unknown
>> Source)
>> 
>>      at com.lowagie.text.pdf.PdfPKCS7.<init>(Unknown Source)
>> 
>>      at 
>> com.lowagie.text.pdf.AcroFields.verifySignature(Unknown Source)
>> 
>> Anyone have any suggestions?
>> 
>> I am using Java 1.4, iText 2.1.2, and BouncyCastle libraries 1.39
>> 
>> I appreciate any assistance.
> 
> 
> 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.
> 
> 
> 
> 
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> Do you like iText?
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> Or leave a tip: https://tipit.to/itexttipjar
> 

-- 
View this message in context: 
http://www.nabble.com/Error-when-verifying-signature-tp18391044p18401608.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to