KickJava   Java API By Example, From Geeks To Geeks.

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


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
17 /**
18  * RootCACertificateProfile is a class defining the fixed characteristics of a root ca certificate profile.
19  *
20  * @version $Id: RootCACertificateProfile.java,v 1.4 2006/11/01 11:54:01 anatom Exp $
21  */

22 public class RootCACertificateProfile extends CertificateProfile{
23
24     // Public Constants
25

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

33     public RootCACertificateProfile() {
34
35       setType(TYPE_ROOTCA);
36       setAllowValidityOverride(true);
37       setUseKeyUsage(true);
38       setKeyUsage(new boolean[9]);
39       setKeyUsage(DIGITALSIGNATURE,true);
40       setKeyUsage(KEYCERTSIGN,true);
41       setKeyUsage(CRLSIGN,true);
42       setKeyUsageCritical(true);
43       
44     }
45
46     // Public Methods.
47

48     public void upgrade(){
49         if(Float.compare(LATEST_VERSION, getVersion()) != 0) {
50             // New version of the class, upgrade
51
super.upgrade();
52         }
53     }
54     // Private fields.
55
}
56
Popular Tags