KickJava   Java API By Example, From Geeks To Geeks.

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


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  * HardTokenEncCertificateProfile is a class defining the fixed characteristics of a hard token authentication certificate.
20  *
21  * @version $Id: HardTokenEncCertificateProfile.java,v 1.3 2006/05/28 14:21:08 anatom Exp $
22  */

23 public class HardTokenEncCertificateProfile extends CertificateProfile{
24
25     // Public Constants
26

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

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

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