KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > oyster > der > DERBoolean


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.der;
10
11 import org.enhydra.oyster.exception.SMIMEException;
12
13
14 /**
15  * DERInteger is primitive type of DER encoded object which represents boolean
16  * value in ASN.1 notation.
17  */

18 public class DERBoolean extends DERObject {
19
20 /**
21  * Constructs the DER encoded boolean value
22  * @param b0 can be true or false.
23  * @exception SMIMEException thrown in super class constructor.
24  */

25   public DERBoolean (boolean b0) throws SMIMEException
26   {
27     super(1);
28     byte[] temp = {
29       0x00
30     };
31     if (b0) {
32       temp[0] = (byte)0xFF;
33       this.addContent(temp);
34     }
35     else
36       this.addContent(temp);
37   }
38 }
39
40
41
42
Popular Tags