1 19 20 package com.maverick.crypto.asn1; 21 22 import java.io.ByteArrayOutputStream ; 23 import java.io.IOException ; 24 import java.util.Enumeration ; 25 26 29 public class DERConstructedSequence 30 extends ASN1Sequence 31 { 32 public void addObject( 33 DEREncodable obj) 34 { 35 super.addObject(obj); 36 } 37 38 public int getSize() 39 { 40 return size(); 41 } 42 43 51 void encode( 52 DEROutputStream out) 53 throws IOException 54 { 55 ByteArrayOutputStream bOut = new ByteArrayOutputStream (); 56 DEROutputStream dOut = new DEROutputStream(bOut); 57 Enumeration e = this.getObjects(); 58 59 while (e.hasMoreElements()) 60 { 61 Object obj = e.nextElement(); 62 63 dOut.writeObject(obj); 64 } 65 66 dOut.close(); 67 68 byte[] bytes = bOut.toByteArray(); 69 70 out.writeEncoded(SEQUENCE | CONSTRUCTED, bytes); 71 } 72 } 73 | Popular Tags |