KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > ca > certificateprofiles > HardTokenSignCertificateProfile


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.model.ca.certificateprofiles;
15
16 import java.util.ArrayList JavaDoc;
17
18 /**
19  * HardTokenSignCertificateProfile is a class defining the fixed characteristics
20  * of a hard token sign certificate.
21  *
22  * @version $Id: HardTokenSignCertificateProfile.java,v 1.3 2006/05/28 14:21:08 anatom Exp $
23  */

24 public class HardTokenSignCertificateProfile extends CertificateProfile{
25
26     // Public Constants
27

28     public static final String JavaDoc CERTIFICATEPROFILENAME = "HARDTOKEN_SIGN";
29
30     // Public Methods
31
/** Creates a certificate with the characteristics of an end user.
32      * General options are set in the superclass's default contructor that is called automatically.
33      * You can override the general options by defining them again with different parameters here.
34      */

35     public HardTokenSignCertificateProfile() {
36
37       setType(TYPE_ENDENTITY);
38
39       setUseKeyUsage(true);
40       setKeyUsage(new boolean[9]);
41       setKeyUsage(NONREPUDIATION,true);
42       setKeyUsageCritical(true);
43
44       setUseExtendedKeyUsage(true);
45       ArrayList JavaDoc eku = new ArrayList JavaDoc();
46       eku.add(new Integer JavaDoc(EMAILPROTECTION));
47       setExtendedKeyUsage(eku);
48       setExtendedKeyUsageCritical(false);
49       
50     }
51
52     // Public Methods.
53
public void upgrade(){
54         if(Float.compare(LATEST_VERSION, getVersion()) != 0) {
55             // New version of the class, upgrade
56

57             super.upgrade();
58         }
59     }
60
61
62     // Private fields.
63
}
64
Popular Tags