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 |
|
package issrg.ac.attributes; |
47 |
|
import iaik.asn1.*; |
48 |
|
import issrg.ac.IssuerSerial; |
49 |
|
import java.util.Vector; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
@author |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
|
|
| 60.5% |
Uncovered Elements: 17 (43) |
Complexity: 6 |
Complexity Density: 0.6 |
|
75 |
|
public class AuthorityAttributeIdentifier extends issrg.ac.Extension { |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
public static final String AUTHORITY_ATTRIBUTE_IDENTIFIER_OID = "2.5.29.38"; |
81 |
|
|
82 |
|
private IssuerSerial[] issuers; |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
19
|
public static void registerMe() {... |
91 |
19
|
issrg.ac.Extensions.registerExtension(AUTHORITY_ATTRIBUTE_IDENTIFIER_OID, AuthorityAttributeIdentifier.class); |
92 |
|
} |
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
@param |
99 |
|
|
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0
|
public AuthorityAttributeIdentifier(AuthorityAttributeIdentifier e) throws CodingException {... |
102 |
0
|
super(AUTHORITY_ATTRIBUTE_IDENTIFIER_OID, false, e.getExtensionValue()); |
103 |
|
} |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
@param |
108 |
|
|
109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
110 |
1
|
public AuthorityAttributeIdentifier (IssuerSerial[] issuerSerials) {... |
111 |
1
|
super(AUTHORITY_ATTRIBUTE_IDENTIFIER_OID, false); |
112 |
1
|
setIssuerSerials(issuerSerials); |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
115 |
0
|
public Object clone(){... |
116 |
0
|
try { |
117 |
0
|
return new AuthorityAttributeIdentifier(this); |
118 |
0
|
} catch (CodingException ce) {return null;} |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
@param |
126 |
|
|
|
|
| 81.8% |
Uncovered Elements: 2 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
127 |
538
|
public void decodeValue(ASN1Object ao) throws CodingException {... |
128 |
538
|
if (ao.getAsnType()!=ASN.SEQUENCE){ |
129 |
0
|
throw new CodingException("SEQUENCE was expected in AttributeAuthorityIdentifier extension"); |
130 |
|
} |
131 |
538
|
Vector s = new Vector(); |
132 |
538
|
int num = ao.countComponents(); |
133 |
1076
|
for (int i = 0; i < num; i++) s.add(new IssuerSerial(ao.getComponentAt(i))); |
134 |
538
|
issuers = (IssuerSerial[]) s.toArray(new IssuerSerial[0]); |
135 |
|
} |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
@return |
142 |
|
|
143 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
144 |
40
|
public ASN1Object encodeValue() throws CodingException {... |
145 |
40
|
SEQUENCE s=new SEQUENCE(); |
146 |
|
|
147 |
80
|
for(int i=0; i<issuers.length; i++){ |
148 |
40
|
s.addComponent(issuers[i].toASN1Object()); |
149 |
|
} |
150 |
40
|
return s; |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
@param |
157 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
158 |
538
|
public AuthorityAttributeIdentifier(ASN1Object ao) throws CodingException{... |
159 |
538
|
super(ao); |
160 |
|
} |
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
@return |
165 |
|
|
166 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
167 |
0
|
public IssuerSerial [] getIssuerSerials(){... |
168 |
0
|
return issuers; |
169 |
|
} |
170 |
|
|
171 |
|
|
172 |
|
|
173 |
|
@param |
174 |
|
|
175 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
176 |
1
|
public void setIssuerSerials(IssuerSerial [] is){... |
177 |
1
|
issuers=is; |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
@param |
183 |
|
@return |
184 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
185 |
0
|
public String extensionValueToString(String indent){... |
186 |
0
|
String ret = ""; |
187 |
0
|
for (int i = 0; i < issuers.length; i++) ret=ret+issuers[i].toString(indent); |
188 |
0
|
return ret; |
189 |
|
} |
190 |
|
} |