1 package com.lowagie.bc.asn1; 2 3 import java.io.ByteArrayOutputStream; 4 import java.io.IOException; 5 import java.util.Enumeration; 6 7 10 public class DERConstructedSequence 11 extends ASN1Sequence 12 { 13 public void addObject( 14 DEREncodable obj) 15 { 16 super.addObject(obj); 17 } 18 19 public int getSize() 20 { 21 return size(); 22 } 23 24 32 void encode( 33 DEROutputStream out) 34 throws IOException 35 { 36 ByteArrayOutputStream bOut = new ByteArrayOutputStream(); 37 DEROutputStream dOut = new DEROutputStream(bOut); 38 Enumeration e = this.getObjects(); 39 40 while (e.hasMoreElements()) 41 { 42 Object obj = e.nextElement(); 43 44 dOut.writeObject(obj); 45 } 46 47 dOut.close(); 48 49 byte[] bytes = bOut.toByteArray(); 50 51 out.writeEncoded(SEQUENCE | CONSTRUCTED, bytes); 52 } 53 } 54 | Popular Tags |