pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4662) ClassCastException: org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject
Date Wed, 02 Oct 2019 17:38:00 GMT

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

ASF subversion and git services commented on PDFBOX-4662:
---------------------------------------------------------

Commit 1867893 from Tilman Hausherr in branch 'pdfbox/branches/issue4569'
[ https://svn.apache.org/r1867893 ]

PDFBOX-4662: avoid ClassCastException by using base classes, because of different BC behaviour
1.62 and 1.63

> ClassCastException: org.bouncycastle.asn1.DLTaggedObject cannot be cast to org.bouncycastle.asn1.DERTaggedObject
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4662
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4662
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Crypto
>    Affects Versions: 2.0.17
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.18, 3.0.0 PDFBox
>
>         Attachments: QV_RCA1_RCA3_CPCPS_V4_11.pdf
>
>
> I get this with the attached file:
> {noformat}
> Exception in thread "main" java.lang.ClassCastException: org.bouncycastle.asn1.DLTaggedObject
cannot be cast to org.bouncycastle.asn1.DERTaggedObject
> 	at org.apache.pdfbox.examples.signature.cert.CertificateVerifier.extractOCSPURL(CertificateVerifier.java:397)
> 	at org.apache.pdfbox.examples.signature.cert.CertificateVerifier.checkRevocations(CertificateVerifier.java:197)
> 	at org.apache.pdfbox.examples.signature.cert.CertificateVerifier.verifyCertificate(CertificateVerifier.java:151)
> 	at org.apache.pdfbox.examples.signature.ShowSignature.verifyCertificateChain(ShowSignature.java:901)
> {noformat}
> Solution: replace DERTaggedObject with ASN1TaggedObject. The exception is related to
a change in BC. The latest 2.0 branch doesn't have the problem, but it uses 1.60 while the
trunk uses 1.63. The error doesn't happen with 1.62. The changes doesn't break the 2.0 branch
so I'll change it there too, to avoid trouble for people who use 1.63 with the code. My impression
of looking at the source code is that the difference between the two classes is in encoding,
which we don't use.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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


Mime
View raw message