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 import org.enhydra.oyster.der.DERInteger; 14 import org.enhydra.oyster.der.DEROctetString; 15 16 17 32 public class RC2CBCParameter extends DERSequencePr { 33 34 43 public RC2CBCParameter (int lenKey0, byte[] iv0) throws SMIMEException 44 { 45 int version; 46 47 if (lenKey0 == 40) 48 version = 160; 49 else if (lenKey0 == 64) 50 version = 120; 51 else if (lenKey0 == 128) 52 version = 58; 53 else 54 throw new SMIMEException(this, 1014); 55 super.addContent(new DERInteger(version).getDEREncoded()); 56 if (iv0.length != 8) 57 throw new SMIMEException(this, 1012); 58 super.addContent(new DEROctetString(iv0).getDEREncoded()); 59 } 60 } 61 62 63 64 | Popular Tags |