[ 
https://issues.apache.org/jira/browse/PDFBOX-6042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18009054#comment-18009054
 ] 

Tilman Hausherr commented on PDFBOX-6042:
-----------------------------------------

That one isn't a bug, it is because BC isn't in the classpath, see the 
dependencies page:
https://github.com/apache/pdfbox-docs/blob/master/content/3.0/dependencies.md
"Public key encryption/decryption and signatures"
(It has been updated recently to be more clear, because I was contacted about 
your problem)

I could add a further error log in the code, but you'll still get the crash. 
And even if BC is installed, you'll get a different error: "Provided decryption 
material is not compatible with the document - did you pass a null keyStore?"

> NoClassDefFoundError
> --------------------
>
>                 Key: PDFBOX-6042
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6042
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: David Justamante
>            Priority: Minor
>         Attachments: example.pdf
>
>
> This issue is being manually filed by the competition organizers. We 
> recognize there is a number of AI generated submissions as of late. We have 
> gone through the manual process of bug/patch validation to prevent 
> unnecessary "noise", respecting maintainers' time. 
> This submission is being sent as part of DARPA's AIxCC competition. 
> (https://aicyberchallenge.com) This issue was discovered by an autonomous 
> Cyber Reasoning System (CRS) and validated by competition engineers. 
> We are grateful for your recent updates to the documentation around this 
> behavior, and we expect this JIRA issue to be closed as "fixed." 
> Nevertheless, we wanted to report this publicly and share a triggering file.
> When using PDFBox alone (without the BouncyCastle dependencies on the 
> classpath) simply trying to load a PDF that requires a 
> PublicKeySecurityHandler causes a NoClassDefFoundError because of a missing 
> BouncyCastle class definition: {{org/bouncycastle/cms/CMSException}}
> Repro code:
> {{PDDocument pdDocument = Loader.load(new File("example.pdf"));}}
> {{}}
> (AIxCC Internal: CHA-1732){{{}{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to