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
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.