KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

27     public static final String JavaDoc CERTIFICATEPROFILENAME = "OCSPSIGNER";
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 OCSPSignerCertificateProfile() {
35
36       setType(TYPE_ENDENTITY);
37
38       // Default key usage for an OCSP signer is digitalSignature
39
// Create an array for KeyUsage acoording to X509Certificate.getKeyUsage()
40
setUseKeyUsage(true);
41       setKeyUsage(new boolean[9]);
42       setKeyUsage(DIGITALSIGNATURE,true);
43       setKeyUsageCritical(true);
44
45       setUseExtendedKeyUsage(true);
46       ArrayList JavaDoc eku = new ArrayList JavaDoc();
47       eku.add(new Integer JavaDoc(OCSPSIGNING));
48       setExtendedKeyUsage(eku);
49       setExtendedKeyUsageCritical(false);
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

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