Clover Coverage Report
Coverage timestamp: Sun Mar 23 2008 08:24:39 GMT
12   157   3   1.5
4   35   0.83   8
8     1.25  
1    
 
 
  IndirectIssuer       Line # 71 12 3 8.3% 0.083333336
 
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    /*indirectIssuer EXTENSION ::=
47    {
48    SYNTAX NULL
49    IDENTIFIED BY id-ce-indirectIssuer
50    }
51   
52    The indirect issuer extension is used in either an attribute certificate or a
53    public-key certificate containing the subjectDirectoryAttributes extension
54    issued to a DIS by an SoA. The presence of this extension means that the subject AA
55    (the DIS) is authorized by the SoA to act as a proxy and issue ACs that delegate privileges,
56    on behalf of other delegators. This extension is always non-critical,
57    since it does not matter to a relying party if it understands this extension
58    or not, when the DIS asserts the privileges contained in this certificate by presenting
59    this certificate to the RP */
60   
61   
62    package issrg.ac.attributes;
63    import issrg.ac.Extension;
64    import iaik.asn1.*;
65    import iaik.asn1.structures.*;
66   
67    /**
68    *
69    * @author anhnt
70    */
 
71    public class IndirectIssuer extends issrg.ac.Extension {
72   
73    /**
74    *The string stores the standard OID for the Indirect_Issuer extension 2.5.29.61
75    */
76   
77    public static final String INDIRECT_ISSUER_OID = "2.5.29.61";
78   
79    /**
80    * This method registers this extension as an extension with a specific
81    * OID. After it has been registered, Extensions can recognise
82    * the extension with this OID.
83    */
84   
 
85  19 toggle public static void registerMe() {
86  19 issrg.ac.Extensions.registerExtension(INDIRECT_ISSUER_OID, IndirectIssuer.class);
87    }
88   
89   
90    /** Creates a new instance of IndirectIssuer based on an
91    *existing IndirectIssuer extension
92    *
93    *@param e is an IndirectIssuer extension
94    */
95   
 
96  0 toggle public IndirectIssuer(IndirectIssuer e){
97  0 this();
98    }
99   
100    /**
101    * This method creates a default instance of IndirectIssuer extension
102    *
103    */
104   
 
105  0 toggle public IndirectIssuer () {
106  0 super(INDIRECT_ISSUER_OID, false);
107    }
108   
 
109  0 toggle public Object clone(){
110  0 return new IndirectIssuer(this);
111    }
112   
113    /**
114    * This method constructs the extension based on an ASN1Object object
115    *@param ao is the ASN1Object object that is used to construct the IndirectIssuer object.
116    */
117   
 
118  0 toggle public IndirectIssuer(ASN1Object ao) throws CodingException{
119  0 super(ao);
120    }
121   
122    /**
123    * This method decodes a given ASN1Object and upon successful decoding sets
124    * the IndirectIssuer extension for the AC.
125    *
126    * @param ao - ASN1Object to decode
127    */
128   
 
129  0 toggle public void decode(ASN1Object ao) throws CodingException {
130  0 super.decode(ao);
131  0 if (isCritical()) throw new CodingException("IndirectIssuer extension MUST be non-critical");
132    }
133   
134    /**
135    * This method decodes a given ASN1Object and upon successful decoding sets
136    * the extension value for the current IndirectIssuer object.
137    *
138    * @param ao - ASN1Object to decode
139    */
140   
 
141  0 toggle public void decodeValue(ASN1Object ao) throws CodingException{
142  0 super.decodeValue(ao);
143  0 if (!(ao instanceof NULL)){
144  0 throw new CodingException("NULL was expected as the extension value");
145    }
146    }
147   
148    /**
149    * This method encodes the IndirectIssuer object to an ASN1Object.
150    *
151    * @return an ASN1Object object.
152    */
153   
 
154  0 toggle public ASN1Object encodeValue() throws CodingException{
155  0 return Null;
156    }
157    }