Hi,

I didn't find anything obvious (except that your "not signed" file has nothing to do with the signed file). I can't comment on the sign() part because I do not understand that one well. The rest looks ok.

I ran your signed PDF through the showSignature example and got this exception:

Exception in thread "main" java.io.IOException: org.bouncycastle.cms.CMSSignerDigestMismatchException: message-digest attribute value does not match calculated value     at org.apache.pdfbox.examples.signature.ShowSignature.showSignature(ShowSignature.java:215)     at org.apache.pdfbox.examples.signature.ShowSignature.main(ShowSignature.java:84) Caused by: org.bouncycastle.cms.CMSSignerDigestMismatchException: message-digest attribute value does not match calculated value
    at org.bouncycastle.cms.SignerInformation.doVerify(Unknown Source)
    at org.bouncycastle.cms.SignerInformation.verify(Unknown Source)
    at org.apache.pdfbox.examples.signature.ShowSignature.verifyPKCS7(ShowSignature.java:298)     at org.apache.pdfbox.examples.signature.ShowSignature.showSignature(ShowSignature.java:156)
    ... 1 more

Maybe ask your question on stackoverflow too, there's a guy there (mkl) who isn't here and who's very good with signing.

Tilman




Am 03.10.2017 um 18:27 schrieb Michael Lindsay:
Hi Tilman,

I am using the sample code from CreateSignature, the setup is slightly modified 
to use the signing cert and chain from our HSM instead of the keystone and 
private key.

Here is a link to the signed file: https://ufile.io/dlgqh 
<https://ufile.io/dlgqh>
Original: https://ufile.io/3ztdb <https://ufile.io/3ztdb>

Here’s a diff of the changes I’ve made from the example file if that helps:
https://ufile.io/u086p <https://ufile.io/u086p>

Thanks again,
  - Michael

On Oct 3, 2017, at 12:45 AM, Tilman Hausherr <[email protected]> wrote:

Am 03.10.2017 um 02:11 schrieb Michael Lindsay:
When I view the pdf, it says my document has bee altered or corrupted.  Not 
sure where I’m going wrong.

Any help greatly appreciated!
Make sure you're using the sample code from CreateSignature (except sign()).

Also please upload the original and the signed file to a sharehoster. I could 
have a look if something obvious is missing.

Tilman



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to