KickJava   Java API By Example, From Geeks To Geeks.

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


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 /*
15  * CACertificateProfile.java
16  *
17  * Created on den 29 juli 2002, 22:08
18  */

19 package org.ejbca.core.model.ca.certificateprofiles;
20
21
22
23 /**
24  * CACertificateProfile is a class defining the fixed characteristics of a CA certificate profile.
25  *
26  * @version $Id: CACertificateProfile.java,v 1.4 2006/11/01 11:54:01 anatom Exp $
27  */

28 public class CACertificateProfile extends CertificateProfile{
29
30     // Public Constants
31
public static final String JavaDoc CERTIFICATEPROFILENAME = "SUBCA";
32
33     // Public Methods
34

35     /**
36      * Creates a certificate with the characteristics of an end user.
37      * General options are set in the superclass's default contructor that is called automatically.
38      * You can override the general options by defining them again with different parameters here.
39      */

40     public CACertificateProfile() {
41
42       setType(TYPE_SUBCA);
43       setAllowValidityOverride(true);
44       setUseKeyUsage(true);
45       setKeyUsage(new boolean[9]);
46       setKeyUsage(DIGITALSIGNATURE,true);
47       setKeyUsage(KEYCERTSIGN,true);
48       setKeyUsage(CRLSIGN,true);
49       setKeyUsageCritical(true);
50
51     }
52
53     // Public Methods.
54
public void upgrade(){
55         if(Float.compare(LATEST_VERSION, getVersion()) != 0) {
56             // New version of the class, upgrade
57
super.upgrade();
58         }
59     }
60
61     // Private fields.
62
}
63
Popular Tags