Extra test case
import org.bouncycastle.asn1.ASN1ApplicationSpecific;
import org.bouncycastle.asn1.ASN1InputStream;
+import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERApplicationSpecific;
+import org.bouncycastle.asn1.DERTaggedObject;
import org.bouncycastle.util.encoders.Base64;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.SimpleTest;
byte[] longAppSpecificTag = Hex.decode("5F610101");
+ byte[] taggedInteger = Hex.decode("BF2203020101");
+
public String getName()
{
return "Tag";
@@ -104,6 +108,13 @@ public void performTest()
fail("incorrect tag number read on recode (random test value: " + testTag + ")");
}
}
+
+ tagged = new DERTaggedObject(false, 34, new DERTaggedObject(true, 1000, new ASN1Integer(1)));
+
+ if (!areEqual(taggedInteger, tagged.getEncoded()))
+ {
+ fail("incorrect encoding for implicit explicit tagged integer");
+ }
}
public static void main(
