You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Open eSignForms <yo...@gmail.com> on 2012/08/27 20:44:06 UTC

Signing.java example uses now deprecated BouncyCastle APIs

I am looking at PDFBox-SignExample.zip which I think was referenced at
https://issues.apache.org/jira/browse/PDFBOX-912 by Thomas Chojecki on
04/Apr/11 to the download link:
http://media-nation.de/~rayman2200/PDFBox-SignExample.zip

I am trying to use pdfbox 1.7.0 with BounceCastle 1.47 and it shows the
following methods in BC as deprecated:

      gen.addSigner(privKey, (X509Certificate)certList.get(0),
CMSSignedGenerator.DIGEST_SHA256);
      gen.addCertificatesAndCRLs(certStore);
      CMSSignedData signedData = gen.generate(input, false, provider);

Has anybody done this using the newer BC methods? I have the keys and X.509
certificate (but without using a BC/Java keystore) and it works as is, but
not sure how to change it to support non-deprecated APIs.  Yes, this is
probably a BC issue, but I figured the person who wrote the original code
may have a good handle on this as it was being used directly in a PDFBox
signing example.

Thanks for any pointers...

(PDFBOX-953) PDFBox fails to ExtractText from Adobe Acrobat X 256-bit AES encrypted documents

Posted by Chris Bamford <cb...@mimecast.com>.
Hi.

Is there any news on when PDFBox will support this?

Thanks,

- Chris


Chris Bamford
Developer

2 - 8 Balfe Street
Kings Cross,
London, N1 9EG

mobile +44 7860 405292
tel: +44 (0) 207 843 2300
web www.mimecast.com


The information contained in this communication from cbamford@mimecast.com is confidential and may be legally privileged. It is intended solely for use by users@pdfbox.apache.org and others authorized to receive it. If you are not users@pdfbox.apache.org you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful.


Mimecast Ltd. is a company registered in England and Wales with the company number 4698693 VAT No. GB 123 4197 34
Registered Office:2 - 8 Balfe Street, Kings Cross London, N1 9EG Email Address: info@mimecast.com

This email message has been scanned for viruses by Mimecast.
Mimecast delivers a complete managed email solution from a single web based platform.
For more information please visit http://www.mimecast.com

Re: Signing.java example uses now deprecated BouncyCastle APIs

Posted by Thomas Chojecki <in...@rayman2200.de>.
Zitat von Open eSignForms <yo...@gmail.com>:

> Has anybody done this using the newer BC methods? I have the keys and X.509
> certificate (but without using a BC/Java keystore) and it works as is, but
> not sure how to change it to support non-deprecated APIs.

Hi,
I have done this for the new BC API and it work a bit easier.

You can take a look here:

http://www.bouncycastle.org/wiki/display/JA1/BC+Version+2+APIs

Also you can check the javadoc for the CMSSignedDataGenerator, it  
contian an example

http://deic-dc0.uab.es/sc/bouncyCastleAPICerts/org/bouncycastle/cms/CMSSignedDataGenerator.html

If you google for this classes you will hopefully find some more examples.

Best regards
Thomas