1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
package issrg.ac; |
77 |
|
|
78 |
|
import iaik.asn1.*; |
79 |
|
import iaik.asn1.structures.*; |
80 |
|
import java.math.BigInteger; |
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
|
|
| 35.6% |
Uncovered Elements: 47 (73) |
Complexity: 9 |
Complexity Density: 0.55 |
|
86 |
|
public class IssuerSerial implements ASN1Type, Cloneable{ |
87 |
|
|
88 |
|
protected GeneralNames issuer = new GeneralNames(); |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
0
|
public GeneralNames getIssuer(){... |
94 |
0
|
return issuer; |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0
|
public void setIssuer(GeneralNames issuer){... |
101 |
0
|
this.issuer=issuer; |
102 |
|
} |
103 |
|
|
104 |
|
protected BigInteger serial = new BigInteger("0"); |
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
0
|
public BigInteger getSerial(){... |
110 |
0
|
return serial; |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0
|
public void setSerial(BigInteger serial){... |
117 |
0
|
this.serial=serial; |
118 |
|
} |
119 |
|
|
120 |
|
public BIT_STRING issuerUID = null; |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
0
|
public BIT_STRING getIssuerUID(){... |
127 |
0
|
return issuerUID; |
128 |
|
} |
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
134 |
0
|
public void setIssuerUID(BIT_STRING issuerUID){... |
135 |
0
|
this.issuerUID=issuerUID; |
136 |
|
} |
137 |
|
|
138 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
139 |
0
|
protected IssuerSerial() {}... |
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
@param |
145 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
146 |
1076
|
public IssuerSerial(ASN1Object ao) throws CodingException{... |
147 |
1076
|
decode(ao); |
148 |
|
} |
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
@param |
154 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
155 |
0
|
public IssuerSerial(IssuerSerial is) throws CodingException{... |
156 |
0
|
issuer = new GeneralNames(is.issuer.toASN1Object()); |
157 |
0
|
serial = new BigInteger(is.serial.toByteArray()); |
158 |
|
|
159 |
0
|
if (is.issuerUID!=null){ |
160 |
0
|
issuerUID = new BIT_STRING(is.issuerUID.getBinaryString()); |
161 |
|
} |
162 |
|
} |
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
@param |
168 |
|
@param |
169 |
|
|
170 |
|
@param |
171 |
|
|
172 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
173 |
2
|
public IssuerSerial(GeneralNames issuer, BigInteger serial, BIT_STRING issuerUID){... |
174 |
2
|
this.issuer = issuer; |
175 |
2
|
this.serial = serial; |
176 |
2
|
this.issuerUID = issuerUID; |
177 |
|
} |
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
@return |
183 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
184 |
80
|
public ASN1Object toASN1Object() throws CodingException{... |
185 |
80
|
ASN1Object result = new SEQUENCE(); |
186 |
|
|
187 |
80
|
result.addComponent(issuer.toASN1Object()); |
188 |
80
|
result.addComponent(new INTEGER(serial)); |
189 |
|
|
190 |
80
|
if (issuerUID!=null){ |
191 |
0
|
result.addComponent(issuerUID); |
192 |
|
} |
193 |
|
|
194 |
80
|
return result; |
195 |
|
} |
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
@param |
202 |
|
|
|
|
| 46.2% |
Uncovered Elements: 14 (26) |
Complexity: 6 |
Complexity Density: 0.38 |
|
203 |
1076
|
public void decode(ASN1Object ao) throws CodingException{... |
204 |
1076
|
if (!ao.isA(ASN.SEQUENCE)){ |
205 |
0
|
throw new CodingException("IssuerSerial SEQUENCE tag was expected"); |
206 |
|
} |
207 |
|
|
208 |
1076
|
if (ao.countComponents()<2){ |
209 |
0
|
throw new CodingException("Mandatory entries are omitted in IssuerSerial tag"); |
210 |
|
} |
211 |
|
|
212 |
1076
|
issuer = new GeneralNames(ao.getComponentAt(0)); |
213 |
1076
|
serial = (BigInteger) ((INTEGER)ao.getComponentAt(1)).getValue(); |
214 |
1076
|
issuerUID = null; |
215 |
|
|
216 |
1076
|
int i=2; |
217 |
|
|
218 |
1076
|
if (ao.countComponents()>2){ |
219 |
0
|
ASN1Object o = ao.getComponentAt(2); |
220 |
|
|
221 |
0
|
if (!(o instanceof BIT_STRING)){ |
222 |
0
|
throw new CodingException("BIT_STRING was expected in IssuerSerial tag"); |
223 |
|
} |
224 |
0
|
issuerUID = (BIT_STRING)o; |
225 |
|
|
226 |
0
|
i++; |
227 |
|
} |
228 |
|
|
229 |
1076
|
if (ao.countComponents()>i){ |
230 |
0
|
throw new CodingException("Too many entries in IssuerSerial tag: "+Integer.toString(ao.countComponents())); |
231 |
|
} |
232 |
|
} |
233 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
234 |
0
|
public String toString(){... |
235 |
0
|
return toString(""); |
236 |
|
} |
237 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 1 |
|
238 |
0
|
public String toString (String indent){... |
239 |
0
|
return "SEQUENCE { -- IssuerSerial --\n "+indent+ |
240 |
|
"issuer = "+issuer.toString()+",\n "+indent+ |
241 |
|
"serial = "+serial.toString()+",\n "+indent+ |
242 |
0
|
"issuerUID = "+((issuerUID!=null)?issuerUID.getBinaryString():"[OPTIONAL; omitted]")+"\n"+indent+"}"; |
243 |
|
} |
244 |
|
|
245 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
246 |
0
|
public Object clone(){... |
247 |
0
|
try{ |
248 |
0
|
return new IssuerSerial(this); |
249 |
|
}catch (CodingException ex){ |
250 |
0
|
ex.printStackTrace(); |
251 |
0
|
return null; |
252 |
|
} |
253 |
|
} |
254 |
|
|
255 |
|
} |
256 |
|
|