KickJava   Java API By Example, From Geeks To Geeks.

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


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  * XKMSCertificateProfile is a class defining the fixed characteristics of an CAs xkms certificate type
19  *
20  * @author Philip Vendil
21  * @version $Id: XKMSCertificateProfile.java,v 1.2 2006/12/27 11:13:57 anatom Exp $
22  */

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

27     public static final String JavaDoc CERTIFICATEPROFILENAME = "XKMSCERT";
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 XKMSCertificateProfile() {
35
36       setType(TYPE_ENDENTITY);
37
38       // Default key usage for an XKMS signer/encrypter is digitalSignature, keyencipherment and dataencipherment
39
// Create an array for KeyUsage acoording to X509Certificate.getKeyUsage()
40
setUseKeyUsage(true);
41       setKeyUsage(new boolean[9]);
42       setKeyUsage(DIGITALSIGNATURE,true);
43       setKeyUsage(KEYENCIPHERMENT,true);
44       setKeyUsage(DATAENCIPHERMENT,true);
45       setKeyUsageCritical(true);
46
47       
48     }
49
50     // Public Methods.
51
public void upgrade(){
52         if(Float.compare(LATEST_VERSION, getVersion()) != 0) {
53             // New version of the class, upgrade
54

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