KickJava   Java API By Example, From Geeks To Geeks.

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


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.io.Serializable JavaDoc;
17 import java.net.MalformedURLException JavaDoc;
18 import java.net.URL JavaDoc;
19 import java.util.ArrayList JavaDoc;
20 import java.util.Collection JavaDoc;
21 import java.util.Collections JavaDoc;
22 import java.util.HashMap JavaDoc;
23 import java.util.Iterator JavaDoc;
24 import java.util.List JavaDoc;
25
26 import org.apache.commons.lang.StringUtils;
27 import org.apache.log4j.Logger;
28 import org.ejbca.core.ejb.ca.store.CertificateDataBean;
29 import org.ejbca.core.model.InternalResources;
30 import org.ejbca.core.model.UpgradeableDataHashMap;
31 import org.ejbca.util.dn.DNFieldExtractor;
32
33
34 /**
35  * CertificateProfile is a basic class used to customize a certificate
36  * configuration or be inherited by fixed certificate profiles.
37  *
38  * @version $Id: CertificateProfile.java,v 1.19 2007/01/16 11:43:26 anatom Exp $
39  */

40 public class CertificateProfile extends UpgradeableDataHashMap implements Serializable JavaDoc, Cloneable JavaDoc {
41     private static final Logger log = Logger.getLogger(CertificateProfile.class);
42     /** Internal localization of logs and errors */
43     private static final InternalResources intres = InternalResources.getInstance();
44
45     // Default Values
46
public static final float LATEST_VERSION = (float) 20.0;
47
48     /**
49      * Determines if a de-serialized file is compatible with this class.
50      *
51      * Maintainers must change this value if and only if the new version
52      * of this class is not compatible with old versions. See Sun docs
53      * for <a HREF=http://java.sun.com/products/jdk/1.1/docs/guide
54      * /serialization/spec/version.doc.html> details. </a>
55      *
56      */

57     private static final long serialVersionUID = -8069608639716545203L;
58
59     /** KeyUsage constants */
60     public static final int DIGITALSIGNATURE = 0;
61     public static final int NONREPUDIATION = 1;
62     public static final int KEYENCIPHERMENT = 2;
63     public static final int DATAENCIPHERMENT = 3;
64     public static final int KEYAGREEMENT = 4;
65     public static final int KEYCERTSIGN = 5;
66     public static final int CRLSIGN = 6;
67     public static final int ENCIPHERONLY = 7;
68     public static final int DECIPHERONLY = 8;
69
70     /** Extended key usage constants */
71     public static final int ANYEXTENDEDKEYUSAGE = 0;
72     public static final int SERVERAUTH = 1;
73     public static final int CLIENTAUTH = 2;
74     public static final int CODESIGNING = 3;
75     public static final int EMAILPROTECTION = 4;
76     public static final int IPSECENDSYSTEM = 5;
77     public static final int IPSECTUNNEL = 6;
78     public static final int IPSECUSER = 7;
79     public static final int TIMESTAMPING = 8;
80     public static final int SMARTCARDLOGON = 9;
81     public static final int OCSPSIGNING = 10;
82     
83     public static final String JavaDoc[] EXTENDEDKEYUSAGEOIDSTRINGS = {"1.3.6.1.5.5.7.3.0", "1.3.6.1.5.5.7.3.1", "1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.3", "1.3.6.1.5.5.7.3.4",
84                                                               "1.3.6.1.5.5.7.3.5", "1.3.6.1.5.5.7.3.6", "1.3.6.1.5.5.7.3.7", "1.3.6.1.5.5.7.3.8", "1.3.6.1.4.1.311.20.2.2", "1.3.6.1.5.5.7.3.9"};
85
86     /** Microsoft Template Constants */
87     public static final String JavaDoc MSTEMPL_DOMAINCONTROLLER = "DomainController";
88     
89     public static final String JavaDoc[] AVAILABLE_MSTEMPLATES = {MSTEMPL_DOMAINCONTROLLER};
90     
91     public static final String JavaDoc TRUE = "true";
92     public static final String JavaDoc FALSE = "false";
93
94     public static final int TYPE_ENDENTITY = CertificateDataBean.CERTTYPE_ENDENTITY;
95     public static final int TYPE_SUBCA = CertificateDataBean.CERTTYPE_SUBCA;
96     public static final int TYPE_ROOTCA = CertificateDataBean.CERTTYPE_ROOTCA;
97     public static final int NUMBER_OF_TYPES = 3;
98
99     /** Supported certificate versions. */
100     public static final String JavaDoc VERSION_X509V3 = "X509v3";
101     public static final String JavaDoc CERTIFICATEPROFILENAME = "CUSTOM";
102     
103     /** Constant indicating that any CA can be used with this certificate profile.*/
104     public static final int ANYCA = -1;
105
106     /** Contant holding the default available bit lengths for certificate profiles */
107     public static final int[] DEFAULTBITLENGTHS= {0,192,239,256,384,512,1024,2048,4096};
108     
109     // protected fields.
110
protected static final String JavaDoc CERTVERSION = "certversion";
111     protected static final String JavaDoc VALIDITY = "validity";
112     protected static final String JavaDoc ALLOWVALIDITYOVERRIDE = "allowvalidityoverride";
113     protected static final String JavaDoc USEBASICCONSTRAINTS = "usebasicconstrants";
114     protected static final String JavaDoc BASICCONSTRAINTSCRITICAL = "basicconstraintscritical";
115     protected static final String JavaDoc USEKEYUSAGE = "usekeyusage";
116     protected static final String JavaDoc KEYUSAGECRITICAL = "keyusagecritical";
117     protected static final String JavaDoc USESUBJECTKEYIDENTIFIER = "usesubjectkeyidentifier";
118     protected static final String JavaDoc SUBJECTKEYIDENTIFIERCRITICAL = "subjectkeyidentifiercritical";
119     protected static final String JavaDoc USEAUTHORITYKEYIDENTIFIER = "useauthoritykeyidentifier";
120     protected static final String JavaDoc AUTHORITYKEYIDENTIFIERCRITICAL = "authoritykeyidentifiercritical";
121     protected static final String JavaDoc USECRLNUMBER = "usecrlnumber";
122     protected static final String JavaDoc CRLNUMBERCRITICAL = "crlnumbercritical";
123     protected static final String JavaDoc USESUBJECTALTERNATIVENAME = "usesubjectalternativename";
124     protected static final String JavaDoc SUBJECTALTERNATIVENAMECRITICAL = "subjectalternativenamecritical";
125     protected static final String JavaDoc USECRLDISTRIBUTIONPOINT = "usecrldistributionpoint";
126     protected static final String JavaDoc USEDEFAULTCRLDISTRIBUTIONPOINT = "usedefaultcrldistributionpoint";
127     protected static final String JavaDoc CRLDISTRIBUTIONPOINTCRITICAL = "crldistributionpointcritical";
128     protected static final String JavaDoc CRLDISTRIBUTIONPOINTURI = "crldistributionpointuri";
129     protected static final String JavaDoc CRLISSUER = "crlissuer";
130     protected static final String JavaDoc USECERTIFICATEPOLICIES = "usecertificatepolicies";
131     protected static final String JavaDoc CERTIFICATEPOLICIESCRITICAL = "certificatepoliciescritical";
132     protected static final String JavaDoc CERTIFICATEPOLICYID = "certificatepolicyid";
133     /** Policy Notice Url to CPS field alias in the data structure */
134     protected static final String JavaDoc POLICY_NOTICE_CPS_URL = "policynoticecpsurl";
135     /** Policy Notice User Notice field alias in the data structure */
136     protected static final String JavaDoc POLICY_NOTICE_UNOTICE_TEXT = "policynoticeunoticetext";
137     protected static final String JavaDoc AVAILABLEBITLENGTHS = "availablebitlengths";
138     protected static final String JavaDoc KEYUSAGE = "keyusage";
139     protected static final String JavaDoc MINIMUMAVAILABLEBITLENGTH = "minimumavailablebitlength";
140     protected static final String JavaDoc MAXIMUMAVAILABLEBITLENGTH = "maximumavailablebitlength";
141     public static final String JavaDoc TYPE = "type";
142     protected static final String JavaDoc ALLOWKEYUSAGEOVERRIDE = "allowkeyusageoverride";
143     protected static final String JavaDoc USEEXTENDEDKEYUSAGE = "useextendedkeyusage";
144     protected static final String JavaDoc EXTENDEDKEYUSAGE = "extendedkeyusage";
145     protected static final String JavaDoc EXTENDEDKEYUSAGECRITICAL = "extendedkeyusagecritical";
146     protected static final String JavaDoc AVAILABLECAS = "availablecas";
147     protected static final String JavaDoc USEDPUBLISHERS = "usedpublishers";
148     protected static final String JavaDoc USEOCSPSERVICELOCATOR = "useocspservicelocator";
149     protected static final String JavaDoc USEDEFAULTOCSPSERVICELOCATOR = "usedefaultocspservicelocator";
150     protected static final String JavaDoc OCSPSERVICELOCATORURI = "ocspservicelocatoruri";
151     protected static final String JavaDoc USEMICROSOFTTEMPLATE = "usemicrosofttemplate";
152     protected static final String JavaDoc MICROSOFTTEMPLATE = "microsofttemplate";
153     protected static final String JavaDoc USECNPOSTFIX = "usecnpostfix";
154     protected static final String JavaDoc CNPOSTFIX = "cnpostfix";
155     protected static final String JavaDoc USESUBJECTDNSUBSET = "usesubjectdnsubset";
156     protected static final String JavaDoc SUBJECTDNSUBSET = "subjectdnsubset";
157     protected static final String JavaDoc USESUBJECTALTNAMESUBSET = "usesubjectaltnamesubset";
158     protected static final String JavaDoc SUBJECTALTNAMESUBSET = "subjectaltnamesubset";
159     protected static final String JavaDoc USEPATHLENGTHCONSTRAINT = "usepathlengthconstraint";
160     protected static final String JavaDoc PATHLENGTHCONSTRAINT = "pathlengthconstraint";
161     protected static final String JavaDoc USEQCSTATEMENT = "useqcstatement";
162     protected static final String JavaDoc USEPKIXQCSYNTAXV2 = "usepkixqcsyntaxv2";
163     protected static final String JavaDoc QCSTATEMENTCRITICAL = "useqcstatementcritical";
164     protected static final String JavaDoc QCSTATEMENTRANAME = "useqcstatementraname";
165     protected static final String JavaDoc QCSSEMANTICSID = "useqcsematicsid";
166     protected static final String JavaDoc USEQCETSIQCCOMPLIANCE = "useqcetsiqccompliance";
167     protected static final String JavaDoc USEQCETSIVALUELIMIT = "useqcetsivaluelimit";
168     protected static final String JavaDoc QCETSIVALUELIMIT = "qcetsivaluelimit";
169     protected static final String JavaDoc QCETSIVALUELIMITEXP = "qcetsivaluelimitexp";
170     protected static final String JavaDoc QCETSIVALUELIMITCURRENCY = "qcetsivaluelimitcurrency";
171     protected static final String JavaDoc USEQCETSISIGNATUREDEVICE = "useqcetsisignaturedevice";
172     protected static final String JavaDoc USEQCCUSTOMSTRING = "useqccustomstring";
173     protected static final String JavaDoc QCCUSTOMSTRINGOID = "qccustomstringoid";
174     protected static final String JavaDoc QCCUSTOMSTRINGTEXT = "qccustomstringtext";
175     protected static final String JavaDoc USESUBJECTDIRATTRIBUTES = "usesubjectdirattributes";
176     protected static final String JavaDoc USEDCERTIFICATEEXTENSIONS = "usedcertificateextensions";
177      
178     // Public Methods
179

180     /**
181      * Creates a new instance of CertificateProfile
182      *
183      * These settings are general for all sub-profiles, only differing values are overridden
184      * in the sub-profiles. If changing any present value here you must therefore go through all
185      * sub-profiles and add an override there.
186      * I.e. only add new values here, don't change any present settings.
187      */

188     public CertificateProfile() {
189       setCertificateVersion(VERSION_X509V3);
190       setValidity(730);
191       setAllowValidityOverride(false);
192
193       setUseBasicConstraints(true);
194       setBasicConstraintsCritical(true);
195
196       setUseSubjectKeyIdentifier(true);
197       setSubjectKeyIdentifierCritical(false);
198
199       setUseAuthorityKeyIdentifier(true);
200       setAuthorityKeyIdentifierCritical(false);
201
202       setUseSubjectAlternativeName(true);
203       setSubjectAlternativeNameCritical(false);
204
205       setUseCRLDistributionPoint(false);
206       setUseDefaultCRLDistributionPoint(false);
207       setCRLDistributionPointCritical(false);
208       setCRLDistributionPointURI("");
209
210       setUseCertificatePolicies(false);
211       setCertificatePoliciesCritical(false);
212       setCertificatePolicyId("2.5.29.32.0");
213       setCpsUrl("");
214       setUserNoticeText("");
215
216       setType(TYPE_ENDENTITY);
217
218       
219       setAvailableBitLengths(DEFAULTBITLENGTHS);
220
221       setUseKeyUsage(true);
222       setKeyUsage(new boolean[9]);
223       setAllowKeyUsageOverride(true);
224       setKeyUsageCritical(true);
225
226       setUseExtendedKeyUsage(false);
227       setExtendedKeyUsage(new ArrayList JavaDoc());
228       setExtendedKeyUsageCritical(false);
229
230       ArrayList JavaDoc availablecas = new ArrayList JavaDoc();
231       availablecas.add(new Integer JavaDoc(ANYCA));
232       setAvailableCAs(availablecas);
233       
234       setPublisherList(new ArrayList JavaDoc());
235       
236       setUseOCSPServiceLocator(false);
237       setUseDefaultOCSPServiceLocator(false);
238       setOCSPServiceLocatorURI("");
239
240       setUseMicrosoftTemplate(false);
241       setMicrosoftTemplate("");
242       
243       setUseCNPostfix(false);
244       setCNPostfix("");
245       
246       setUseSubjectDNSubSet(false);
247       setSubjectDNSubSet(new ArrayList JavaDoc());
248       setUseSubjectAltNameSubSet(false);
249       setSubjectAltNameSubSet(new ArrayList JavaDoc());
250       
251       setUsePathLengthConstraint(false);
252       setPathLengthConstraint(0);
253       
254       setUseQCStatement(false);
255       setUsePkixQCSyntaxV2(false);
256       setQCStatementCritical(false);
257       setQCStatementRAName(null);
258       setQCSemanticsId(null);
259       setUseQCEtsiQCCompliance(false);
260       setUseQCEtsiSignatureDevice(false);
261       setUseQCEtsiValueLimit(false);
262       setQCEtsiValueLimit(0);
263       setQCEtsiValueLimitExp(0);
264       setQCEtsiValueLimitCurrency(null);
265       setUseQCCustomString(false);
266       setQCCustomStringOid(null);
267       setQCCustomStringText(null);
268       
269       setUseSubjectDirAttributes(false);
270       
271       setUsedCertificateExtensions(new ArrayList JavaDoc());
272       
273     }
274
275
276
277     // Public Methods.
278
/** Returns the version of the certificate, should be one of the VERSION_ constants defined in CertificateProfile class. */
279     public String JavaDoc getCertificateVersion(){return (String JavaDoc) data.get(CERTVERSION);}
280     /**
281     * Returns the version of the certificate, should be one of the VERSION_ constants defined in
282     * CertificateProfile class.
283     *
284     * @return DOCUMENT ME!
285     */

286     public void setCertificateVersion(String JavaDoc version){data.put(CERTVERSION,version);}
287
288     public long getValidity(){return ((Long JavaDoc)data.get(VALIDITY)).longValue();}
289     public void setValidity(long validity) { data.put(VALIDITY,new Long JavaDoc(validity));}
290
291     public boolean getAllowValidityOverride(){ return ((Boolean JavaDoc)data.get(ALLOWVALIDITYOVERRIDE)).booleanValue(); }
292     public void setAllowValidityOverride(boolean allowvalidityoverride) {data.put(ALLOWVALIDITYOVERRIDE, Boolean.valueOf(allowvalidityoverride));}
293
294     public boolean getUseBasicConstraints(){ return ((Boolean JavaDoc)data.get(USEBASICCONSTRAINTS)).booleanValue(); }
295     public void setUseBasicConstraints(boolean usebasicconstraints) {data.put(USEBASICCONSTRAINTS, Boolean.valueOf(usebasicconstraints));}
296
297     public boolean getBasicConstraintsCritical(){ return ((Boolean JavaDoc) data.get(BASICCONSTRAINTSCRITICAL)).booleanValue(); }
298     public void setBasicConstraintsCritical(boolean basicconstraintscritical) { data.put(BASICCONSTRAINTSCRITICAL, Boolean.valueOf(basicconstraintscritical));}
299
300     public boolean getUseKeyUsage(){ return ((Boolean JavaDoc) data.get(USEKEYUSAGE)).booleanValue(); }
301     public void setUseKeyUsage(boolean usekeyusage) { data.put(USEKEYUSAGE, Boolean.valueOf(usekeyusage));}
302
303     public boolean getKeyUsageCritical(){ return ((Boolean JavaDoc) data.get(KEYUSAGECRITICAL)).booleanValue(); }
304     public void setKeyUsageCritical(boolean keyusagecritical) { data.put(KEYUSAGECRITICAL, Boolean.valueOf(keyusagecritical));}
305
306     public boolean getUseSubjectKeyIdentifier(){ return ((Boolean JavaDoc) data.get(USESUBJECTKEYIDENTIFIER)).booleanValue(); }
307     public void setUseSubjectKeyIdentifier(boolean usesubjectkeyidentifier) { data.put(USESUBJECTKEYIDENTIFIER, Boolean.valueOf(usesubjectkeyidentifier));}
308
309     public boolean getSubjectKeyIdentifierCritical(){ return ((Boolean JavaDoc) data.get(SUBJECTKEYIDENTIFIERCRITICAL)).booleanValue(); }
310     public void setSubjectKeyIdentifierCritical(boolean subjectkeyidentifiercritical) { data.put(SUBJECTKEYIDENTIFIERCRITICAL, Boolean.valueOf(subjectkeyidentifiercritical));}
311
312     public boolean getUseAuthorityKeyIdentifier(){ return ((Boolean JavaDoc) data.get(USEAUTHORITYKEYIDENTIFIER)).booleanValue(); }
313     public void setUseAuthorityKeyIdentifier(boolean useauthoritykeyidentifier) { data.put(USEAUTHORITYKEYIDENTIFIER, Boolean.valueOf(useauthoritykeyidentifier));}
314
315     public boolean getAuthorityKeyIdentifierCritical(){ return ((Boolean JavaDoc) data.get(AUTHORITYKEYIDENTIFIERCRITICAL)).booleanValue(); }
316     public void setAuthorityKeyIdentifierCritical(boolean authoritykeyidentifiercritical) { data.put(AUTHORITYKEYIDENTIFIERCRITICAL, Boolean.valueOf(authoritykeyidentifiercritical));}
317
318     public boolean getUseSubjectAlternativeName(){ return ((Boolean JavaDoc) data.get(USESUBJECTALTERNATIVENAME)).booleanValue(); }
319     public void setUseSubjectAlternativeName(boolean usesubjectalternativename) { data.put(USESUBJECTALTERNATIVENAME, Boolean.valueOf(usesubjectalternativename));}
320
321     public boolean getSubjectAlternativeNameCritical(){ return ((Boolean JavaDoc) data.get(SUBJECTALTERNATIVENAMECRITICAL)).booleanValue(); }
322     public void setSubjectAlternativeNameCritical(boolean subjectalternativenamecritical) { data.put(SUBJECTALTERNATIVENAMECRITICAL, Boolean.valueOf(subjectalternativenamecritical));}
323
324     public boolean getUseCRLDistributionPoint(){ return ((Boolean JavaDoc) data.get(USECRLDISTRIBUTIONPOINT)).booleanValue(); }
325     public void setUseCRLDistributionPoint(boolean usecrldistributionpoint) { data.put(USECRLDISTRIBUTIONPOINT, Boolean.valueOf(usecrldistributionpoint));}
326
327     public boolean getUseDefaultCRLDistributionPoint(){ return ((Boolean JavaDoc) data.get(USEDEFAULTCRLDISTRIBUTIONPOINT)).booleanValue(); }
328     public void setUseDefaultCRLDistributionPoint(boolean usedefaultcrldistributionpoint) { data.put(USEDEFAULTCRLDISTRIBUTIONPOINT, Boolean.valueOf(usedefaultcrldistributionpoint));}
329     
330     public boolean getCRLDistributionPointCritical(){ return ((Boolean JavaDoc) data.get(CRLDISTRIBUTIONPOINTCRITICAL)).booleanValue(); }
331     public void setCRLDistributionPointCritical(boolean crldistributionpointcritical) { data.put(CRLDISTRIBUTIONPOINTCRITICAL, Boolean.valueOf(crldistributionpointcritical));}
332
333     public String JavaDoc getCRLDistributionPointURI(){ return (String JavaDoc) data.get(CRLDISTRIBUTIONPOINTURI); }
334     public void setCRLDistributionPointURI(String JavaDoc crldistributionpointuri) {
335       if(crldistributionpointuri==null)
336         data.put(CRLDISTRIBUTIONPOINTURI,"");
337       else
338         data.put(CRLDISTRIBUTIONPOINTURI,crldistributionpointuri);
339     }
340     public String JavaDoc getCRLIssuer(){ return (String JavaDoc) data.get(CRLISSUER); }
341     public void setCRLIssuer(String JavaDoc crlissuer) {
342       if(crlissuer==null)
343         data.put(CRLISSUER,"");
344       else
345         data.put(CRLISSUER,crlissuer);
346     }
347
348     public boolean getUseCertificatePolicies() { return ((Boolean JavaDoc) data.get(USECERTIFICATEPOLICIES)).booleanValue(); }
349     public void setUseCertificatePolicies(boolean usecertificatepolicies) { data.put(USECERTIFICATEPOLICIES, Boolean.valueOf(usecertificatepolicies));}
350     public boolean getCertificatePoliciesCritical() { return ((Boolean JavaDoc) data.get(CERTIFICATEPOLICIESCRITICAL)).booleanValue(); }
351     public void setCertificatePoliciesCritical(boolean certificatepoliciescritical) { data.put(CERTIFICATEPOLICIESCRITICAL, Boolean.valueOf(certificatepoliciescritical));}
352     public String JavaDoc getCertificatePolicyId() { return (String JavaDoc) data.get(CERTIFICATEPOLICYID); }
353     public void setCertificatePolicyId(String JavaDoc policyid){
354       if(policyid == null)
355         data.put(CERTIFICATEPOLICYID,"");
356       else
357         data.put(CERTIFICATEPOLICYID,policyid);
358     }
359     public String JavaDoc getCpsUrl() {
360         return (String JavaDoc) data.get(POLICY_NOTICE_CPS_URL);
361     }
362     public void setCpsUrl(String JavaDoc cpsUrl) {
363         try {
364             if (!StringUtils.isEmpty(cpsUrl)) {
365                 // Test that it is a valid url
366
new URL JavaDoc(cpsUrl);
367                 data.put(POLICY_NOTICE_CPS_URL, cpsUrl);
368             } else {
369                 data.put(POLICY_NOTICE_CPS_URL, "");
370             }
371         } catch (MalformedURLException JavaDoc muex) {
372             log.error("CPS url has incorrect format.", muex);
373         }
374     }
375     public String JavaDoc getUserNoticeText() {
376         return (String JavaDoc) data.get(POLICY_NOTICE_UNOTICE_TEXT);
377     }
378     public void setUserNoticeText(String JavaDoc userNoticeText) {
379         if(userNoticeText == null) {
380             data.put(POLICY_NOTICE_UNOTICE_TEXT, "");
381         } else {
382             data.put(POLICY_NOTICE_UNOTICE_TEXT, userNoticeText);
383         }
384     }
385
386     public int getType(){ return ((Integer JavaDoc) data.get(TYPE)).intValue(); }
387     public void setType(int type){ data.put(TYPE, new Integer JavaDoc(type)); }
388     public boolean isTypeCA() { return ((Integer JavaDoc) data.get(TYPE)).intValue() == TYPE_SUBCA; }
389     public boolean isTypeRootCA() { return ((Integer JavaDoc) data.get(TYPE)).intValue() == TYPE_ROOTCA; }
390     public boolean isTypeEndEntity() { return ((Integer JavaDoc) data.get(TYPE)).intValue() == TYPE_ENDENTITY; }
391
392     public int[] getAvailableBitLengths(){
393       ArrayList JavaDoc availablebitlengths = (ArrayList JavaDoc) data.get(AVAILABLEBITLENGTHS);
394       int[] returnval = new int[availablebitlengths.size()];
395
396       for(int i=0; i < availablebitlengths.size(); i++){
397         returnval[i] = ((Integer JavaDoc) availablebitlengths.get(i)).intValue();
398       }
399
400       return returnval;
401     }
402
403     public void setAvailableBitLengths(int[] availablebitlengths){
404       ArrayList JavaDoc availbitlengths = new ArrayList JavaDoc(availablebitlengths.length);
405
406       int minimumavailablebitlength = 99999999;
407       int maximumavailablebitlength = 0;
408
409       for(int i=0;i< availablebitlengths.length;i++){
410         if( availablebitlengths[i] > maximumavailablebitlength)
411           maximumavailablebitlength = availablebitlengths[i];
412         if( availablebitlengths[i] < minimumavailablebitlength)
413           minimumavailablebitlength = availablebitlengths[i];
414
415         availbitlengths.add(new Integer JavaDoc(availablebitlengths[i]));
416       }
417       data.put(AVAILABLEBITLENGTHS, availbitlengths);
418       data.put(MINIMUMAVAILABLEBITLENGTH, new Integer JavaDoc(minimumavailablebitlength));
419       data.put(MAXIMUMAVAILABLEBITLENGTH, new Integer JavaDoc(maximumavailablebitlength));
420     }
421
422     public int getMinimumAvailableBitLength(){return ((Integer JavaDoc) data.get(MINIMUMAVAILABLEBITLENGTH)).intValue();}
423     public int getMaximumAvailableBitLength(){return ((Integer JavaDoc) data.get(MAXIMUMAVAILABLEBITLENGTH)).intValue();}
424
425     public boolean[] getKeyUsage(){
426       ArrayList JavaDoc keyusage = (ArrayList JavaDoc) data.get(KEYUSAGE);
427       boolean[] returnval = new boolean[keyusage.size()];
428
429       for(int i=0; i < keyusage.size(); i++){
430         returnval[i] = ((Boolean JavaDoc) keyusage.get(i)).booleanValue();
431       }
432
433       return returnval;
434     }
435
436     public boolean getKeyUsage(int keyusageconstant){
437       return ((Boolean JavaDoc) ((ArrayList JavaDoc) data.get(KEYUSAGE)).get(keyusageconstant)).booleanValue();
438     }
439
440     public void setKeyUsage(boolean[] keyusage){
441       ArrayList JavaDoc keyuse = new ArrayList JavaDoc(keyusage.length);
442
443       for(int i=0;i< keyusage.length;i++){
444         keyuse.add(Boolean.valueOf(keyusage[i]));
445       }
446       data.put(KEYUSAGE, keyuse);
447     }
448
449     public void setKeyUsage(int keyusageconstant, boolean value){
450       ((ArrayList JavaDoc) data.get(KEYUSAGE)).set(keyusageconstant, Boolean.valueOf(value));
451     }
452
453     public void setAllowKeyUsageOverride(boolean override) {
454         data.put(ALLOWKEYUSAGEOVERRIDE, Boolean.valueOf(override));
455     }
456     public boolean getAllowKeyUsageOverride() {
457         return ((Boolean JavaDoc) data.get(ALLOWKEYUSAGEOVERRIDE)).booleanValue();
458     }
459
460     public void setUseExtendedKeyUsage(boolean use) {
461         data.put(USEEXTENDEDKEYUSAGE, Boolean.valueOf(use));
462     }
463     public boolean getUseExtendedKeyUsage() {
464         return ((Boolean JavaDoc) data.get(USEEXTENDEDKEYUSAGE)).booleanValue();
465     }
466
467     public void setExtendedKeyUsageCritical(boolean critical) {
468         data.put(EXTENDEDKEYUSAGECRITICAL, Boolean.valueOf(critical));
469     }
470     public boolean getExtendedKeyUsageCritical() {
471         return ((Boolean JavaDoc) data.get(EXTENDEDKEYUSAGECRITICAL)).booleanValue();
472     }
473     /**
474      * Extended Key Usage is an arraylist of constant Integers.
475      */

476     public void setExtendedKeyUsage(ArrayList JavaDoc extendedkeyusage) {
477         data.put(EXTENDEDKEYUSAGE, extendedkeyusage);
478     }
479     /**
480      * Extended Key Usage is an arraylist of constant Integers.
481      */

482     public ArrayList JavaDoc getExtendedKeyUsage() {
483         return (ArrayList JavaDoc) data.get(EXTENDEDKEYUSAGE);
484     }
485
486     public boolean getUseMicrosoftTemplate(){
487         return ((Boolean JavaDoc) data.get(USEMICROSOFTTEMPLATE)).booleanValue();
488     }
489     
490     public void setUseMicrosoftTemplate(boolean use){
491         data.put(USEMICROSOFTTEMPLATE, Boolean.valueOf(use));
492     }
493
494     public String JavaDoc getMicrosoftTemplate(){
495         return (String JavaDoc) data.get(MICROSOFTTEMPLATE);
496     }
497     
498     public void setMicrosoftTemplate(String JavaDoc mstemplate){
499         data.put(MICROSOFTTEMPLATE, mstemplate);
500     }
501     
502     public boolean getUseCNPostfix(){
503         return ((Boolean JavaDoc) data.get(USECNPOSTFIX)).booleanValue();
504     }
505     
506     public void setUseCNPostfix(boolean use) {
507         data.put(USECNPOSTFIX, Boolean.valueOf(use));
508     }
509     
510     public String JavaDoc getCNPostfix(){
511         return (String JavaDoc) data.get(CNPOSTFIX);
512     }
513     
514     public void setCNPostfix(String JavaDoc cnpostfix) {
515         data.put(CNPOSTFIX, cnpostfix);
516         
517     }
518     
519     public boolean getUseSubjectDNSubSet(){
520         return ((Boolean JavaDoc) data.get(USESUBJECTDNSUBSET)).booleanValue();
521     }
522     
523     public void setUseSubjectDNSubSet(boolean use) {
524         data.put(USESUBJECTDNSUBSET, Boolean.valueOf(use));
525     }
526     
527     /**
528      * Returns a collection of Integer (DNFieldExtractor constants) indicating
529      * which subject dn fields that should be used in certificate.
530      *
531      */

532     public Collection JavaDoc getSubjectDNSubSet(){
533         return (Collection JavaDoc) data.get(SUBJECTDNSUBSET);
534     }
535
536     /**
537      * Should contain a collection of Integer (DNFieldExtractor constants) indicating
538      * which subject dn fields that should be used in certificate.
539      *
540      */

541     public void setSubjectDNSubSet(Collection JavaDoc subjectdns) {
542         data.put(SUBJECTDNSUBSET, subjectdns);
543         
544     }
545
546     /**
547      * Method taking a full user dn and returns a DN only containing the
548      * DN fields specified in the subjectdn sub set array.
549      *
550      * @param dn
551      * @return a subset of original DN
552      */

553     
554     public String JavaDoc createSubjectDNSubSet(String JavaDoc dn){
555         DNFieldExtractor extractor = new DNFieldExtractor(dn,DNFieldExtractor.TYPE_SUBJECTDN);
556         return constructUserData(extractor, getSubjectDNSubSet(), true);
557     }
558     
559     public boolean getUseSubjectAltNameSubSet(){
560         return ((Boolean JavaDoc) data.get(USESUBJECTALTNAMESUBSET)).booleanValue();
561     }
562     
563     public void setUseSubjectAltNameSubSet(boolean use) {
564         data.put(USESUBJECTALTNAMESUBSET, Boolean.valueOf(use));
565     }
566
567     /**
568      * Returns a collection of Integer (DNFieldExtractor constants) indicating
569      * which subject altnames fields that should be used in certificate.
570      *
571      */

572     public Collection JavaDoc getSubjectAltNameSubSet(){
573         return (Collection JavaDoc) data.get(SUBJECTALTNAMESUBSET);
574     }
575     
576     /**
577      * Returns a collection of Integer (DNFieldExtractor constants) indicating
578      * which subject altnames fields that should be used in certificate.
579      *
580      */

581     public void setSubjectAltNameSubSet(Collection JavaDoc subjectaltnames) {
582         data.put(SUBJECTALTNAMESUBSET, subjectaltnames);
583         
584     }
585
586     
587     /**
588      * Method taking a full user dn and returns a AltName only containing the
589      * AltName fields specified in the subjectaltname sub set array.
590      *
591      * @param dn
592      * @return a subset of original DN
593      */

594     public String JavaDoc createSubjectAltNameSubSet(String JavaDoc subjectaltname){
595         DNFieldExtractor extractor = new DNFieldExtractor(subjectaltname,DNFieldExtractor.TYPE_SUBJECTALTNAME);
596         return constructUserData(extractor, getSubjectAltNameSubSet(), false);
597     }
598     
599     /**
600      * Help method converting a full DN or Subject Alt Name to one usng only specified fields
601      * @param extractor
602      * @param usefields
603      * @return
604      */

605     protected String JavaDoc constructUserData(DNFieldExtractor extractor, Collection JavaDoc usefields, boolean subjectdn){
606         String JavaDoc retval = "";
607                        
608         if(usefields instanceof List JavaDoc){
609           Collections.sort((List JavaDoc) usefields);
610         }
611         Iterator JavaDoc iter = usefields.iterator();
612         String JavaDoc dnField = null;
613         while(iter.hasNext()){
614             Integer JavaDoc next = (Integer JavaDoc) iter.next();
615             dnField = extractor.getFieldString(next.intValue());
616             if (StringUtils.isNotEmpty(dnField)) {
617                 if(retval.length() == 0)
618                   retval += dnField; // first item, don't start with a comma
619
else
620                   retval += "," + dnField;
621             }
622         }
623         
624               
625         log.debug("CertificateProfile: constructed DN or AltName: " + retval );
626         return retval;
627       }
628       
629     /**
630      * Returns an ArrayList of OID.strings defined in constant EXTENDEDKEYUSAGEOIDSTRINGS.
631      */

632     public ArrayList JavaDoc getExtendedKeyUsageAsOIDStrings(){
633       ArrayList JavaDoc returnval = new ArrayList JavaDoc();
634       ArrayList JavaDoc eku = (ArrayList JavaDoc) data.get(EXTENDEDKEYUSAGE);
635       Iterator JavaDoc i = eku.iterator();
636       while(i.hasNext())
637         returnval.add(EXTENDEDKEYUSAGEOIDSTRINGS[((Integer JavaDoc) i.next()).intValue()]);
638
639
640       return returnval;
641     }
642     
643     /**
644      * Returns a Collections of caids (Integer), indicating which CAs the profile should
645      * be applicable to.
646      *
647      * If it contains the constant ANYCA then the profile is applicable to all CAs
648      */

649     public Collection JavaDoc getAvailableCAs(){
650       return (Collection JavaDoc) data.get(AVAILABLECAS);
651     }
652     
653     /**
654      * Saves the CertificateProfile's list of CAs the cert profile is applicable to.
655      *
656      * @param availablecas a Collection of caids (Integer)
657      */

658     
659     public void setAvailableCAs(Collection JavaDoc availablecas){
660       data.put(AVAILABLECAS, availablecas);
661     }
662     
663     public boolean isApplicableToAnyCA(){
664         return ((Collection JavaDoc) data.get(AVAILABLECAS)).contains(new Integer JavaDoc(ANYCA));
665     }
666     
667     /**
668      * Returns a Collection of publisher id's (Integer) indicating which publishers a certificate
669      * created with this profile should be published to.
670      */

671     
672     public Collection JavaDoc getPublisherList(){
673       return (Collection JavaDoc) data.get(USEDPUBLISHERS);
674     }
675     
676     /**
677      * Saves the CertificateProfile's list of publishers that certificates created with this profile
678      * should be published to.
679      *
680      * @param publishers a Collection of publisherids (Integer)
681      */

682     
683     public void setPublisherList(Collection JavaDoc publisher){
684       data.put(USEDPUBLISHERS, publisher);
685     }
686         
687     /**
688      * Method indicating that Path Length Constain should be used in the BasicConstaint
689      *
690      */

691     public boolean getUsePathLengthConstraint(){
692         return ((Boolean JavaDoc) data.get(USEPATHLENGTHCONSTRAINT)).booleanValue();
693     }
694     
695     /**
696      * Method indicating that Path Length Constain should be used in the BasicConstaint
697      *
698      */

699     public void setUsePathLengthConstraint(boolean use) {
700         data.put(USEPATHLENGTHCONSTRAINT, Boolean.valueOf(use));
701     }
702     
703     public int getPathLengthConstraint(){
704         return ((Integer JavaDoc) data.get(PATHLENGTHCONSTRAINT)).intValue();
705     }
706     
707   
708     public void setPathLengthConstraint(int pathlength) {
709         data.put(PATHLENGTHCONSTRAINT, new Integer JavaDoc(pathlength));
710     }
711
712     public boolean getUseOCSPServiceLocator(){ return ((Boolean JavaDoc) data.get(USEOCSPSERVICELOCATOR)).booleanValue(); }
713     public void setUseOCSPServiceLocator(boolean useocspservicelocator) { data.put(USEOCSPSERVICELOCATOR, Boolean.valueOf(useocspservicelocator));}
714     
715     public boolean getUseDefaultOCSPServiceLocator(){ return ((Boolean JavaDoc) data.get(USEDEFAULTOCSPSERVICELOCATOR)).booleanValue(); }
716     public void setUseDefaultOCSPServiceLocator(boolean usedefaultocspservicelocator) { data.put(USEDEFAULTOCSPSERVICELOCATOR, Boolean.valueOf(usedefaultocspservicelocator));}
717
718     public String JavaDoc getOCSPServiceLocatorURI(){ return (String JavaDoc) data.get(OCSPSERVICELOCATORURI); }
719     public void setOCSPServiceLocatorURI(String JavaDoc ocspservicelocatoruri) {
720       if(ocspservicelocatoruri==null)
721         data.put(OCSPSERVICELOCATORURI,"");
722       else
723         data.put(OCSPSERVICELOCATORURI,ocspservicelocatoruri);
724     }
725
726     public boolean getUseQCStatement(){ return ((Boolean JavaDoc) data.get(USEQCSTATEMENT)).booleanValue(); }
727     public void setUseQCStatement(boolean useqcstatement) { data.put(USEQCSTATEMENT, Boolean.valueOf(useqcstatement));}
728     public boolean getUsePkixQCSyntaxV2(){ return ((Boolean JavaDoc) data.get(USEPKIXQCSYNTAXV2)).booleanValue(); }
729     public void setUsePkixQCSyntaxV2(boolean pkixqcsyntaxv2) { data.put(USEPKIXQCSYNTAXV2, Boolean.valueOf(pkixqcsyntaxv2));}
730     public boolean getQCStatementCritical() { return ((Boolean JavaDoc) data.get(QCSTATEMENTCRITICAL)).booleanValue(); }
731     public void setQCStatementCritical(boolean qcstatementcritical) { data.put(QCSTATEMENTCRITICAL, Boolean.valueOf(qcstatementcritical));}
732
733     public String JavaDoc getQCStatementRAName(){ return (String JavaDoc) data.get(QCSTATEMENTRANAME); }
734     public void setQCStatementRAName(String JavaDoc qcstatementraname) {
735       if(qcstatementraname==null)
736         data.put(QCSTATEMENTRANAME,"");
737       else
738         data.put(QCSTATEMENTRANAME,qcstatementraname);
739     }
740     public String JavaDoc getQCSemanticsId(){ return (String JavaDoc) data.get(QCSSEMANTICSID); }
741     public void setQCSemanticsId(String JavaDoc qcsemanticsid) {
742       if(qcsemanticsid==null)
743         data.put(QCSSEMANTICSID,"");
744       else
745         data.put(QCSSEMANTICSID,qcsemanticsid);
746     }
747     public boolean getUseQCEtsiQCCompliance(){ return ((Boolean JavaDoc) data.get(USEQCETSIQCCOMPLIANCE)).booleanValue(); }
748     public void setUseQCEtsiQCCompliance(boolean useqcetsiqccompliance) { data.put(USEQCETSIQCCOMPLIANCE, Boolean.valueOf(useqcetsiqccompliance));}
749     public boolean getUseQCEtsiValueLimit(){ return ((Boolean JavaDoc) data.get(USEQCETSIVALUELIMIT)).booleanValue(); }
750     public void setUseQCEtsiValueLimit(boolean useqcetsivaluelimit) { data.put(USEQCETSIVALUELIMIT, Boolean.valueOf(useqcetsivaluelimit));}
751     public int getQCEtsiValueLimit(){return ((Integer JavaDoc) data.get(QCETSIVALUELIMIT)).intValue();}
752     public void setQCEtsiValueLimit(int qcetsivaluelimit){data.put(QCETSIVALUELIMIT, new Integer JavaDoc(qcetsivaluelimit));}
753     public int getQCEtsiValueLimitExp(){return ((Integer JavaDoc) data.get(QCETSIVALUELIMITEXP)).intValue();}
754     public void setQCEtsiValueLimitExp(int qcetsivaluelimitexp){data.put(QCETSIVALUELIMITEXP, new Integer JavaDoc(qcetsivaluelimitexp));}
755     public String JavaDoc getQCEtsiValueLimitCurrency(){ return (String JavaDoc) data.get(QCETSIVALUELIMITCURRENCY); }
756     public void setQCEtsiValueLimitCurrency(String JavaDoc qcetsicaluelimitcurrency) {
757       if(qcetsicaluelimitcurrency==null)
758         data.put(QCETSIVALUELIMITCURRENCY,"");
759       else
760         data.put(QCETSIVALUELIMITCURRENCY,qcetsicaluelimitcurrency);
761     }
762     public boolean getUseQCEtsiSignatureDevice(){ return ((Boolean JavaDoc) data.get(USEQCETSISIGNATUREDEVICE)).booleanValue(); }
763     public void setUseQCEtsiSignatureDevice(boolean useqcetsisignaturedevice) { data.put(USEQCETSISIGNATUREDEVICE, Boolean.valueOf(useqcetsisignaturedevice));}
764
765     public boolean getUseQCCustomString(){ return ((Boolean JavaDoc) data.get(USEQCCUSTOMSTRING)).booleanValue(); }
766     public void setUseQCCustomString(boolean useqccustomstring) { data.put(USEQCCUSTOMSTRING, Boolean.valueOf(useqccustomstring));}
767     public String JavaDoc getQCCustomStringOid(){ return (String JavaDoc) data.get(QCCUSTOMSTRINGOID); }
768     public void setQCCustomStringOid(String JavaDoc qccustomstringoid) {
769       if(qccustomstringoid==null)
770         data.put(QCCUSTOMSTRINGOID,"");
771       else
772         data.put(QCCUSTOMSTRINGOID,qccustomstringoid);
773     }
774     public String JavaDoc getQCCustomStringText(){ return (String JavaDoc) data.get(QCCUSTOMSTRINGTEXT); }
775     public void setQCCustomStringText(String JavaDoc qccustomstringtext) {
776       if(qccustomstringtext==null)
777         data.put(QCCUSTOMSTRINGTEXT,"");
778       else
779         data.put(QCCUSTOMSTRINGTEXT,qccustomstringtext);
780     }
781
782     public boolean getUseSubjectDirAttributes(){ return ((Boolean JavaDoc) data.get(USESUBJECTDIRATTRIBUTES)).booleanValue(); }
783     public void setUseSubjectDirAttributes(boolean use) { data.put(USESUBJECTDIRATTRIBUTES, Boolean.valueOf(use));}
784
785     /**
786      * Method returning a list of (Integers) of ids of
787      * used certificate extensions. Never null.
788      *
789      * Autoupgradable method
790      */

791     public List JavaDoc getUsedCertificateExtensions(){
792         if(data.get(USEDCERTIFICATEEXTENSIONS) == null){
793             return new ArrayList JavaDoc();
794         }
795         
796         return (List JavaDoc) data.get(USEDCERTIFICATEEXTENSIONS);
797     }
798     
799     /**
800      * Method setting a list of used certificate extensions
801      * a list of Integers containing CertificateExtension Id is expected
802      * @param usedCertificateExtensions
803      */

804     public void setUsedCertificateExtensions(List JavaDoc usedCertificateExtensions) {
805       if(usedCertificateExtensions==null)
806         data.put(USEDCERTIFICATEEXTENSIONS,new ArrayList JavaDoc());
807       else
808         data.put(USEDCERTIFICATEEXTENSIONS,usedCertificateExtensions);
809     }
810     
811     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
812       CertificateProfile clone = new CertificateProfile();
813       HashMap JavaDoc clonedata = (HashMap JavaDoc) clone.saveData();
814
815       Iterator JavaDoc i = (data.keySet()).iterator();
816       while(i.hasNext()){
817         Object JavaDoc key = i.next();
818         clonedata.put(key, data.get(key));
819       }
820
821       clone.loadData(clonedata);
822       return clone;
823     }
824
825     /** Implemtation of UpgradableDataHashMap function getLatestVersion */
826     public float getLatestVersion(){
827        return LATEST_VERSION;
828     }
829
830     /**
831      * Implemtation of UpgradableDataHashMap function upgrade.
832      */

833     public void upgrade(){
834         log.debug(">upgrade");
835         if(Float.compare(LATEST_VERSION, getVersion()) != 0) {
836             // New version of the class, upgrade
837
String JavaDoc msg = intres.getLocalizedMessage("certprofile.upgrade", new Float JavaDoc(getVersion()));
838             log.info(msg);
839
840             if(data.get(ALLOWKEYUSAGEOVERRIDE) == null)
841                 data.put(ALLOWKEYUSAGEOVERRIDE, Boolean.TRUE);
842             if(data.get(USEEXTENDEDKEYUSAGE) ==null)
843                 data.put(USEEXTENDEDKEYUSAGE, Boolean.FALSE);
844             if(data.get(EXTENDEDKEYUSAGE) ==null)
845                 data.put(EXTENDEDKEYUSAGE, new ArrayList JavaDoc());
846             if(data.get(EXTENDEDKEYUSAGECRITICAL) == null)
847                 data.put(EXTENDEDKEYUSAGECRITICAL, Boolean.FALSE);
848             if(data.get(AVAILABLECAS) == null){
849                 ArrayList JavaDoc availablecas = new ArrayList JavaDoc();
850                 availablecas.add(new Integer JavaDoc(ANYCA));
851                 data.put(AVAILABLECAS, availablecas);
852             }
853             if(data.get(USEDPUBLISHERS) == null){
854                 data.put(USEDPUBLISHERS, new ArrayList JavaDoc());
855             }
856             if(data.get(USEOCSPSERVICELOCATOR) == null){
857                 setUseOCSPServiceLocator(false);
858                 setOCSPServiceLocatorURI("");
859             }
860             
861             if(data.get(USEMICROSOFTTEMPLATE) == null){
862                 setUseMicrosoftTemplate(false);
863                 setMicrosoftTemplate("");
864             }
865             
866             if(data.get(USECNPOSTFIX) == null){
867               setUseCNPostfix(false);
868               setCNPostfix("");
869             }
870             
871             if(data.get(USESUBJECTDNSUBSET) == null){
872               setUseSubjectDNSubSet(false);
873               setSubjectDNSubSet(new ArrayList JavaDoc());
874               setUseSubjectAltNameSubSet(false);
875               setSubjectAltNameSubSet(new ArrayList JavaDoc());
876             }
877             
878             if(data.get(USEPATHLENGTHCONSTRAINT) == null){
879                 setUsePathLengthConstraint(false);
880                 setPathLengthConstraint(0);
881             }
882             
883             if(data.get(USEQCSTATEMENT) == null){
884                 setUseQCStatement(false);
885                 setUsePkixQCSyntaxV2(false);
886                 setQCStatementCritical(false);
887                 setQCStatementRAName(null);
888                 setQCSemanticsId(null);
889                 setUseQCEtsiQCCompliance(false);
890                 setUseQCEtsiSignatureDevice(false);
891                 setUseQCEtsiValueLimit(false);
892                 setQCEtsiValueLimit(0);
893                 setQCEtsiValueLimitExp(0);
894                 setQCEtsiValueLimitCurrency(null);
895             }
896             
897             if(data.get(USEDEFAULTCRLDISTRIBUTIONPOINT) == null){
898                 setUseDefaultCRLDistributionPoint(false);
899                 setUseDefaultOCSPServiceLocator(false);
900             }
901             
902             if (data.get(POLICY_NOTICE_UNOTICE_TEXT) == null) {
903                 setUserNoticeText(null); // This actually isn't nessecary but for the principle we do it
904
}
905             if (data.get(POLICY_NOTICE_CPS_URL) == null) {
906                 setCpsUrl(null); // This actually isn't nessecary but for the principle we do it
907
}
908             if (data.get(USEQCCUSTOMSTRING) == null) {
909                 setUseQCCustomString(false);
910                 setQCCustomStringOid(null);
911                 setQCCustomStringText(null);
912             }
913             if (data.get(USESUBJECTDIRATTRIBUTES) == null) {
914                 setUseSubjectDirAttributes(false);
915             }
916             if(data.get(ALLOWVALIDITYOVERRIDE) == null) {
917                 setAllowValidityOverride(false);
918             }
919             
920             if(data.get(CRLISSUER) == null) {
921                 setCRLIssuer(null); // v20
922
}
923             
924             data.put(VERSION, new Float JavaDoc(LATEST_VERSION));
925         }
926         log.debug("<upgrade");
927     }
928     
929 }
Popular Tags