KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > oyster > cms > CMSVersion


1 /*
2  * Title: Oyster Project
3  * Description: S/MIME email sending capabilities
4  * @Author Vladimir Radisic
5  * @Version 2.1.5
6  */

7
8
9 package org.enhydra.oyster.cms;
10
11 import org.enhydra.oyster.exception.SMIMEException;
12 import org.enhydra.oyster.der.DERInteger;
13
14
15 /**
16  * CMSVersion class is DER encoded integer represented in ASN.1 notation
17  * according to RFC2630.<BR>
18  * <BR>
19  * CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }<BR>
20  */

21 public class CMSVersion extends DERInteger {
22
23 /**
24  * Construction is possible only for few discret integer values
25  * @param ver0 can be 0, 1, 2, 3 or 4
26  * @exception SMIMEException if parameter ver0 is not from group 0, 1, 2, 3 or 4.
27  * Also, it can be thrown from super class constructor.
28  */

29   public CMSVersion (int ver0) throws SMIMEException
30   {
31     super(ver0);
32     if ((ver0 != 0) & (ver0 != 1) & (ver0 != 2) & (ver0 != 3) & (ver0 != 4))
33       throw new SMIMEException(this, 1019);
34   }
35 }
36
37
38
39
Popular Tags