1 package org.bouncycastle.asn1;
6 public class BERConstructedSequence
7 extends DERConstructedSequence
10 * A note on the implementation:
12 * As DER requires the constructed, definite-length model to
13 * be used for structured types, this varies slightly from the
14 * ASN.1 descriptions given. Rather than just outputing SEQUENCE,
15 * we also have to specify CONSTRUCTED, and the objects length.
21 if (out instanceof BEROutputStream)
23 ByteArrayOutputStream bOut = new ByteArrayOutputStream();
24 BEROutputStream dOut = new BEROutputStream(bOut);
25 Enumeration e = getObjects();
27 while (e.hasMoreElements())
29 Object obj = e.nextElement();
31 dOut.writeObject(obj);
36 byte[] bytes = bOut.toByteArray();
38 out.write(SEQUENCE | CONSTRUCTED);