1 7 8 9 package org.enhydra.oyster.cms; 10 11 import org.enhydra.oyster.exception.SMIMEException; 12 import org.enhydra.oyster.der.DERClassContextSpecific; 13 import org.enhydra.oyster.der.DERSequencePr; 14 import org.enhydra.oyster.der.DEROctetString; 15 16 29 public class EncapsulatedContentInfo extends DERSequencePr { 30 31 34 int orderIdentifier = 0; 35 36 40 public EncapsulatedContentInfo () throws SMIMEException 41 { 42 } 43 44 50 public void addContentType (byte[] contType0) throws SMIMEException { 51 if (orderIdentifier == 0) { 52 super.addContent(contType0); 53 orderIdentifier++; 54 } 55 else 56 throw new SMIMEException(this, 1018); 57 } 58 59 65 public void addEncapsulatedContent (byte[] cont0) throws SMIMEException { 66 if (orderIdentifier == 1) { 67 DERClassContextSpecific eContent = new DERClassContextSpecific(0, true); 68 eContent.addContent(new DEROctetString(cont0).getDEREncoded()); 69 super.addContent(eContent.getDEREncoded()); 70 orderIdentifier++; 71 } 72 else 73 throw new SMIMEException(this, 1018); 74 } 75 } 76 77 78 79 | Popular Tags |