Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.17
-
None
Description
I get this with the attached file:
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)
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.