1 19 20 package com.maverick.crypto.asn1; 21 22 import java.io.IOException ; 23 import java.io.OutputStream ; 24 25 public class ASN1OutputStream 26 extends DEROutputStream 27 { 28 public ASN1OutputStream( 29 OutputStream os) 30 { 31 super(os); 32 } 33 34 public void writeObject( 35 Object obj) 36 throws IOException  37 { 38 if (obj == null) 39 { 40 writeNull(); 41 } 42 else if (obj instanceof DERObject) 43 { 44 ((DERObject)obj).encode(this); 45 } 46 else if (obj instanceof DEREncodable) 47 { 48 ((DEREncodable)obj).getDERObject().encode(this); 49 } 50 else 51 { 52 throw new IOException ("object not ASN1Encodable"); 53 } 54 } 55 } 56 | Popular Tags |