1 package org.bouncycastle.asn1;
6 public class DERConstructedSequence
21 * A note on the implementation:
23 * As DER requires the constructed, definite-length model to
24 * be used for structured types, this varies slightly from the
25 * ASN.1 descriptions given. Rather than just outputing SEQUENCE,
26 * we also have to specify CONSTRUCTED, and the objects length.
32 ByteArrayOutputStream bOut = new ByteArrayOutputStream();
33 DEROutputStream dOut = new DEROutputStream(bOut);
34 Enumeration e = this.getObjects();
36 while (e.hasMoreElements())
38 Object obj = e.nextElement();
40 dOut.writeObject(obj);
45 byte[] bytes = bOut.toByteArray();
47 out.writeEncoded(SEQUENCE | CONSTRUCTED, bytes);