public void testNestedImplicitTagDerWriting()
throws Exception
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DerSequenceGenerator seqGen1 = new DerSequenceGenerator(bOut);
seqGen1.addObject(new Asn1Integer(BigInteger.valueOf(0)));
seqGen1.addObject(new Asn1ObjectIdentifier("1.1"));
DerSequenceGenerator seqGen2 = new DerSequenceGenerator(seqGen1.getRawOutputStream(), 1, false);
seqGen2.addObject(new Asn1Integer(BigInteger.valueOf(1)));
seqGen2.close();
seqGen1.close();
assertTrue("nested implicit tagged DER writing test failed.", Arrays.equals(nestedSeqImpTagData, bOut.toByteArray()));
}