1 7 8 9 package org.enhydra.oyster.cms; 10 11 import org.enhydra.oyster.exception.SMIMEException; 12 import org.enhydra.oyster.der.DERSequencePr; 13 14 15 30 public class SignedData extends DERSequencePr { 31 32 35 int orderIdentifier = 0; 36 37 41 public SignedData () throws SMIMEException 42 { 43 } 44 45 51 public void addCMSVersion (byte[] ver0) throws SMIMEException { 52 if (orderIdentifier == 0) { 53 super.addContent(ver0); 54 orderIdentifier++; 55 } 56 else 57 throw new SMIMEException(this, 1018); 58 } 59 60 66 public void addDigestAlgorithm (byte[] digAlg0) throws SMIMEException { 67 if (orderIdentifier == 1) { 68 super.addContent(digAlg0); 69 orderIdentifier++; 70 } 71 else 72 throw new SMIMEException(this, 1018); 73 } 74 75 81 public void addEncapsulatedContentInfo (byte[] encCont0) throws SMIMEException { 82 if (orderIdentifier == 2) { 83 super.addContent(encCont0); 84 orderIdentifier++; 85 } 86 else 87 throw new SMIMEException(this, 1018); 88 } 89 90 96 public void addCertificate (byte[] cert0) throws SMIMEException { 97 if (orderIdentifier == 3) { 98 super.addContent(cert0); 99 orderIdentifier++; 100 } 101 else 102 throw new SMIMEException(this, 1018); 103 } 104 105 111 public void addSignerInfos (byte[] info0) throws SMIMEException { 112 if (orderIdentifier == 3) { 113 super.addContent(info0); 114 orderIdentifier++; 115 orderIdentifier++; 116 } 117 else if (orderIdentifier == 4) { 118 super.addContent(info0); 119 orderIdentifier++; 120 } 121 else 122 throw new SMIMEException(this, 1018); 123 } 124 } 125 126 127 128 | Popular Tags |