Clover Coverage Report
Coverage timestamp: Sun Mar 23 2008 08:24:39 GMT
0   443   1   -
0   47   -   0
0     -  
1    
 
 
  EnvironmentalVariables       Line # 98 0 1 - -1.0
 
No Tests
 
1    /*
2    * Copyright (c) 2006, University of Kent
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are met:
7    *
8    * Redistributions of source code must retain the above copyright notice, this
9    * list of conditions and the following disclaimer.
10    *
11    * Redistributions in binary form must reproduce the above copyright notice,
12    * this list of conditions and the following disclaimer in the documentation
13    * and/or other materials provided with the distribution.
14    *
15    * 1. Neither the name of the University of Kent nor the names of its
16    * contributors may be used to endorse or promote products derived from this
17    * software without specific prior written permission.
18    *
19    * 2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22    * PURPOSE ARE DISCLAIMED.
23    *
24    * 3. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25    * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28    * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29    * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31    * POSSIBILITY OF SUCH DAMAGE.
32    *
33    * 4. YOU AGREE THAT THE EXCLUSIONS IN PARAGRAPHS 2 AND 3 ABOVE ARE REASONABLE
34    * IN THE CIRCUMSTANCES. IN PARTICULAR, YOU ACKNOWLEDGE (1) THAT THIS
35    * SOFTWARE HAS BEEN MADE AVAILABLE TO YOU FREE OF CHARGE, (2) THAT THIS
36    * SOFTWARE IS NOT "PRODUCT" QUALITY, BUT HAS BEEN PRODUCED BY A RESEARCH
37    * GROUP WHO DESIRE TO MAKE THIS SOFTWARE FREELY AVAILABLE TO PEOPLE WHO WISH
38    * TO USE IT, AND (3) THAT BECAUSE THIS SOFTWARE IS NOT OF "PRODUCT" QUALITY
39    * IT IS INEVITABLE THAT THERE WILL BE BUGS AND ERRORS, AND POSSIBLY MORE
40    * SERIOUS FAULTS, IN THIS SOFTWARE.
41    *
42    * 5. This license is governed, except to the extent that local laws
43    * necessarily apply, by the laws of England and Wales.
44    */
45   
46    /*
47    * Copyright (c) 2000-2005, University of Salford
48    * All rights reserved.
49    *
50    * Redistribution and use in source and binary forms, with or without
51    * modification, are permitted provided that the following conditions are met:
52    *
53    * Redistributions of source code must retain the above copyright notice, this
54    * list of conditions and the following disclaimer.
55    *
56    * Redistributions in binary form must reproduce the above copyright notice,
57    * this list of conditions and the following disclaimer in the documentation
58    * and/or other materials provided with the distribution.
59    *
60    * Neither the name of the University of Salford nor the names of its
61    * contributors may be used to endorse or promote products derived from this
62    * software without specific prior written permission.
63    *
64    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
65    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
66    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
67    * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
68    * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
69    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
70    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
71    * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
72    * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
73    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74    * POSSIBILITY OF SUCH DAMAGE.
75    */
76   
77    package issrg.utils;
78   
79   
80    //import issrg.acm.KernelApplication;
81   
82    /**
83    * This class is a declaration of variable names for the
84    * operational Environment of the Privilege Allocator. This class contains
85    * a lot of public String variables that must be referred to when putting
86    * anything into the Environment. For example,
87    * <p><code>
88    * env.put(EntrustSigningUtility.DEFAULT_PROFILE_STRING, "c:\\Entrust Profiles\\fred.epf");
89    * </code><p>or<p><code>
90    * if (env.get(EnvironmentalVariables.FORCE_V1_STRING)==null)...//allow v.2 syntax
91    * </code><p>
92    *
93    * @author A Otenko
94    * @version 1.0
95    */
96   
97   
 
98    final public class EnvironmentalVariables {
99   
100    /**
101    * The variable with this name, if present in the Environment, would notify the
102    * PrivilegeEditors being loaded that the GUI part is not required in this
103    * application (e.g.&nbsp;the TSAP is also a <code>Registry</code>; it never uses
104    * <code>PrivilegeEditor.run</code> method). This allows them to optimise their
105    * memory and disk size, because
106    * they would not load their GUI part then. It is not a must for the editors to
107    * check for this variable; if they don't, they must always load the GUI, if
108    * they provide it.
109    *
110    * <p>This variable must be set before the
111    * editors are loaded from their class files.
112    */
113    public static final String GUI_NOT_REQUIRED_FLAG = "GUI not required";
114   
115    /**
116    * The variable with this name contains a <code>String</code>, representing
117    * the name of the digest algorithm to use. You should not need to set
118    * this. This is for Privilege Editors to consult, if their building process
119    * depends on this value.
120    */
121    public static final String DIGEST_ALGORITHM_NAME_STRING = "Digest Algorithm Name String";
122   
123    /**
124    * The variable with this name, if present, requires the Privilege Allocator
125    * to use Attribute Certificate version 1 syntax, even if <code>V2_STRING</code> variable
126    * is also present. You should set this whenever you want to enforce this
127    * functionality. You cannot set this in the configuration file. However, this
128    * can be overriddden by the user,
129    * if he chooses an appropriate radio button.
130    *
131    * <p>Version 1 ACs are accepted wider, but provide less
132    * service.
133    *
134    * @see #V2_FLAG
135    */
136    public static final String FORCE_V1_FLAG = "Force Version 1 AC";
137   
138    /**
139    * The variable with this name, if present, allows the Privilege Allocator
140    * to produce ACs of version 2 syntax. By default, it is always present, and
141    * you do not have to set it manually. If <code>FORCE_V1_STRING</code> variable
142    * is present, it overrides this setting.
143    *
144    * @see #FORCE_V1_FLAG
145    */
146    public static final String V2_FLAG = "Build Version 2 AC";
147   
148    /**
149    * The variable with this name specifies the signing algorithm for the
150    * certificate. You should not set this. This is a read-only variable, and
151    * is set in accordance with what is stipulated in the signing key. May be
152    * not set, if a new certificate is created (never has been signed).
153    */
154    public static final String SIGNING_ALGORITHM_ALGORITHMID = "AC.SigningAlgorithm";
155   
156    /**
157    * The variable with this name contains a <code>iaik.asn1.BIT_STRING</code> of
158    * the signature value, got directly from the AC. May
159    * not be present. Actually, you might not need to know this value anyway.
160    */
161    public static final String SIGNATURE_VALUE_BIT_STRING = "AC.SignatureValue";
162   
163    /**
164    * The variable with this name contains a Vector of
165    * <code>issrg.ac.Attribute</code>. You should not wish to set this, unless
166    * you have an absolute necessity to do so. Intended for Privilege Editors to
167    * consult, if their
168    * decision depends on what Attributes are already there; e.g.&nbsp;in order not
169    * to set a contradictory attribute value.
170    */
171    public static final String ATTRIBUTES_VECTOR = "AC.Attributes";
172   
173    /**
174    * The variable with this name contains a Vector of
175    * <code>issrg.ac.Extension</code>. You should not set this, unless you have
176    * an absolute necessity to do so; e.g. in order to add a corresponding
177    * extension, when a PrivilegePolicy attribute is added.
178    */
179    public static final String EXTENSIONS_VECTOR = "AC.Extensions";
180   
181    /**
182    * The variable with this name contains a <code>String</code> value that the
183    * AC Holder will be set to. At the moment, the Privilege Allocator supports
184    * LDAP DNs only, therefore the name must be a valid LDAP DN. The Manager user
185    * may change this at run time.
186    *
187    * <p>You may wish to set this in the configuration file. The variable name to
188    * set is "AC.Holder.Name".
189    */
190    public static final String HOLDER_NAME_STRING = "AC.Holder.Name";
191   
192    /**
193    * The variable with this name conains a <code>String</code> value that the AC
194    * Holder baseCertificateID will be set to. The format of the string is as
195    * follows: &lt;PKC SN&gt;';'&lt;PKC Issuer Name&gt;. There is no means to put
196    * the Issuer Unique Identifier there.
197    * At the moment the Privilege
198    * Allocator supports LDAP DNs only, so the PKC Issuer name must be a valid
199    * LDAP DN. The PKC SN must be a valid integer value. No extra spaces before or
200    * after the semicolon are allowed. The Manager user may change this at run time.
201    *
202    * <p>You may wish to set this in the configuration file. The variable name to
203    * set is "AC.Holder.BCID".
204    */
205    public static final String HOLDER_BCID_STRING = "AC.Holder.BCID";
206   
207    /**
208    * The variable with this name contains an <code>issrg.ac.ObjectDigestInfo</code>
209    * value that the AC Holder entry will contain. You may set this, but ensure
210    * version 2 AC can be generated. At the moment there is no constructor for
211    * this value, but you may want to build one. You must put them in the [editors]
212    * section of the configuration file.
213    *
214    * @see KernelApplication
215    */
216    public static final String HOLDER_OBJECT_DIGEST_INFO_OBJECTDIGESTINFO = "AC.Holder.ObjectDigestInfo";
217   
218    /**
219    * The variable with this name holds a <code>String</code> representation of
220    * the AC Issuer name. The syntax is the same as for <code>HOLDER_NAME_STRING</code>.
221    * The name of the variable to set in the configuration file is "AC.Issuer.Name".
222    *
223    * @see #HOLDER_NAME_STRING
224    */
225    public static final String ISSUER_NAME_STRING = "AC.Issuer.Name";
226   
227    /**
228    * The variable with this name holds a <code>String</code> representation of
229    * the AC Issuer baseCertificateID. The syntax is the same as for
230    * <code>HOLDER_BCID_STRING</code>. The name of the variable to set in the
231    * configuration file is "AC.Issuer.BCID". Ensure that version 2 can be used.
232    *
233    * @see #HOLDER_BCID_STRING
234    */
235    public static final String ISSUER_BCID_STRING = "AC.Issuer.BCID";
236   
237    /**
238    * The variable with this name contains an <code>issrg.ac.ObjectDigestInfo</code>
239    * value that the AC Issuer entry will contain. You may set this, but ensure
240    * version 2 AC can be generated. At the moment there is no constructor for
241    * this value, but you may want to build one. You must put them in the [editors]
242    * section of the configuration file.
243    *
244    * @see KernelApplication
245    */
246    public static final String ISSUER_OBJECT_DIGEST_INFO_OBJECTDIGESTINFO = "AC.Issuer.ObjectDigestInfo";
247   
248    /**
249    * The variable with this name contains V2Form entry for the Attribute
250    * Certificate as <code>issrg.ac.V2Form</code> object. You may set
251    * this.
252    */
253    public static final String ISSUER_V2_FORM_V2FORM = "AC.Issuer.V2Form";
254   
255    /**
256    * The variable with this name contains a <code>String</code> representation
257    * of the serial number of the AC. This may be set in the configuration file,
258    * or you may wish to maintain your database of AC serial numbers, and
259    * automatically pick the number from it. The user still can change it at run
260    * time.
261    *
262    * <p>The variable name to be set in the configuration file is "AC.SerialNumber".
263    */
264    public static final String SERIAL_NUMBER_STRING = "AC.SerialNumber";
265   
266    /**
267    * The variable with this name contains a <code>String</code> representation
268    * of the Issuer Unique Id. The whole string is converted into byte array and
269    * that is the BIT STRING for the Issuer Unique ID to be put into the AC. The
270    * Manager user may change it at run time.
271    *
272    * <p>The variable name to be set in the configuration file is "AC.UID".
273    */
274    public static final String ISSUER_UID_STRING = "AC.UID";
275   
276    /**
277    * The variable with this name contains a <code>String</code> representation
278    * of the AC Validity period. The syntax for the string is as follows:
279    * &lt;Not before Time&gt;';'&lt;Not after Time&gt;, each of the times being
280    * of the following format: 'ccyy.mm.dd hh:mm:ss'. In fact, the syntax is a bit
281    * more flexible, but for simplicity of the documentation I do not explain the
282    * freedoms. You may omit any of the times, but the semicolon must remain to
283    * distinguish which of the times is missing.
284    *
285    * <p>The variable to be set in the configuration file is "AC.ValidityPeriod".
286    */
287    public static final String VALIDITY_PERIOD_STRING = "AC.ValidityPeriod";
288   
289    /**
290    * The variable with this name contains a <code>String</code> representation
291    * of the AC Version: the number. This can be set in the configuration file
292    * only. Otherwise it will be ignored.
293    *
294    * <p>The variable name to be set is "AC.Version".
295    */
296    public static final String VERSION_STRING = "AC.Version";
297   
298    /**
299    * This is the name of the collection of the variables in the <code>Registry</code>.
300    * In order to obtain the whole environment, use getCollection method, and
301    * cast it to <code>java.util.Map</code>.
302    */
303    public static final String VARIABLES_COLLECTION = "Variables";
304   
305    /**
306    * This is the name of the collection of the AttributeEditors in the
307    * <code>Registry</code>.
308    *
309    * @see #VARIABLES_COLLECTION
310    */
311    public static final String ATTRIBUTE_EDITORS_COLLECTION = "AttributeEditors";
312   
313    /**
314    * This is the name of the collection of the ExtensionEditors in the
315    * <code>Registry</code>.
316    *
317    * @see #VARIABLES_COLLECTION
318    */
319    public static final String EXTENSION_EDITORS_COLLECTION = "ExtensionEditors";
320   
321    /**
322    * This is the name of the collection of the <code>Utility</code> objects in the
323    * <code>Registry</code>.
324    *
325    * @see #VARIABLES_COLLECTION
326    */
327    public static final String UTILITIES_COLLECTION = "Constructors and utilities";
328   
329    /**
330    * This is the name of the collection of variables the Manager remembers between
331    * creations of different ACs.
332    */
333    public static final String PERSISTENT_VARIABLES_COLLECTION = "Persistent variables";
334   
335    /**
336    * This is the name under which the Saving Utilities must register in the
337    * <code>UTILITIES_COLLECTION</code> collection.
338    *
339    * @see #VARIABLES_COLLECTION
340    */
341    public static final String SAVING_UTILITY = "Saving Utility";
342   
343    /**
344    * This is the name under which the Signing Utilities must register in the
345    * <code>UTILITIES_COLLECTION</code> collection.
346    *
347    * @see #VARIABLES_COLLECTION
348    */
349    public static final String SIGNING_UTILITY = "Signing Utility";
350   
351    /**
352    * This is the name under which the Holder Editor Utilities must register in the
353    * <code>UTILITIES_COLLECTION</code> collection.
354    *
355    * @see #VARIABLES_COLLECTION
356    */
357    public static final String HOLDER_EDITOR_UTILITY = "Holder Editor Utility";
358   
359   
360   
361    public static final String HOLDER_EDITOR_UTILITY_SERVER = EnvironmentalVariables.LDAP_SAVING_UTILITY_LDAP_PROVIDER;
362   
363    //Addition of the instant revocation webdav url:
364    public static final String WEBDAV_REVOCATION_LOCATION ="Webdav.revocation.location";
365    public static final String WEBDAV_CERTIFICATE_LOCATION ="Webdav.certificate.location";
366   
367    public static final String WEBDAV_HOLDER_EDITOR_UTILITY = "WebDAV Holder Editor Utility";
368    public static final String WEBDAV_HOST = "WebDAVSavingUtility.Host";
369    public static final String WEBDAV_PORT = "WebDAVSavingUtility.Port";
370    public static final String WEBDAV_PROTOCOL = "WebDAVSavingUtility.Protocol";
371    public static final String WEBDAV_P12FILENAME = "WebDAVSavingUtility.P12Filename";
372    public static final String WEBDAV_P12PASSWORD = "WebDAVSavingUtility.P12Password";
373    public static final String WEBDAV_SSLCERTIFICATE ="WebDAVSavingUtility.SSLCertificate";
374    /**
375    * This is the name under which the Serial Number Editor Utilities must register in the
376    * <code>UTILITIES_COLLECTION</code> collection.
377    *
378    * @see #VARIABLES_COLLECTION
379    */
380    public static final String SERIAL_NUMBER_EDITOR_UTILITY = "Serial Number Editor Utility";
381   
382    /**
383    * This is the name under which the UID Editor Utilities must register in the
384    * <code>UTILITIES_COLLECTION</code> collection.
385    *
386    * @see #VARIABLES_COLLECTION
387    */
388    public static final String UID_EDITOR_UTILITY = "UID Editor Utility";
389   
390    /**
391    * This is the name under which the Validity Period Editor Utilities must register in the
392    * <code>UTILITIES_COLLECTION</code> collection.
393    *
394    * @see #VARIABLES_COLLECTION
395    */
396    public static final String VALIDITY_PERIOD_EDITOR_UTILITY = "Validity Period Editor Utility";
397   
398    /**
399    * This is the name for AttributeCertificate stored in LDAP
400    *
401    *
402    */
403   
404   
405    /**
406    *This is the name under which we store and retrieve the truststore for mutual
407    *authentication with the DIS
408    */
409    public static final String TRUSTSTORE = "truststore";
410    /**
411    *This is the name under which we store and retrive the AAIA extension
412    */
413    public static final String AAIA_LOCATION = "AAIA extension";
414   
415    //This is the flag which decides to use the AIA extensions in the AttributeCertificates
416   
417    public static final String AIA_LOCATION ="AIA extension";
418   
419    /**
420    * The variable, containing the name of the configuration variable, representing
421    * the LDAP server URI. At the moment it is "LDAPSavingUtility.ProviderURI".
422    */
423    final public static String LDAP_SAVING_UTILITY_LDAP_PROVIDER = "LDAPSavingUtility.ProviderURI";
424   
425   
426    /**
427    * This can be set by the Manager implementation that uses other cryptography
428    * tools, but Entrust. This must be a <code>java.security.PrivateKey</code>
429    * object. The object will be used to call JCE for signing.
430    */
431    //public static final String ISSUER_SIGNING_KEY_PRIVATEKEY = "Issuer.SigningKey";
432   
433    /**
434    * This can be set by the Manager implementation that uses other cryptography but
435    * Entrust. This must be a <code>java.security.cert.X509Certificate</code>
436    * object.
437    */
438    //public static final String ISSUER_X509_CERTIFICATE_X509CERTIFICATE = "Issuer.X509Certificate";
439    }
440   
441   
442   
443