79392887

Date: 2025-01-28 06:21:51
Score: 3.5
Natty:
Report link

To solve it;

  1. as @Tilman Hausherr mentioned, one should add required dependencies

https://pdfbox.apache.org/3.0/dependencies.html

  1. as @Tilman Hausherr mentioned, one should add the provider as below

Security.addProvider(new BouncyCastleProvider());

  1. as @mkl mentioned, one should change the signatureAlgorithm on

https://github.com/apache/pdfbox/blob/3.0/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignatureBase.java

ContentSigner sha1Signer = new JcaContentSignerBuilder(XXX).build(privateKey);

where (in my case) for domain certificates, XXX= "SHA256WithECDSA"

PS, one can find the working project at https://github.com/tugalsan/com.tugalsan.blg.pdf.pdfbox3.sign/tree/main

Reasons:
  • Probably link only (1):
  • No code block (0.5):
  • User mentioned (1): @Tilman
  • User mentioned (0): @Tilman
  • User mentioned (0): @mkl
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Tugalsan Karabacak