1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.pkix.params.x509certificate.extension; |
21 |
|
|
22 |
|
import java.util.Collection; |
23 |
|
import java.util.Collections; |
24 |
|
import java.util.HashSet; |
25 |
|
import java.util.Set; |
26 |
|
|
27 |
|
import org.bouncycastle.asn1.x509.Extension; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 5 |
Complexity Density: 1 |
|
35 |
|
public class ExtendedKeyUsages |
36 |
|
{ |
37 |
|
|
38 |
|
public static final String OID = Extension.extendedKeyUsage.getId(); |
39 |
|
|
40 |
|
|
41 |
|
public static final String ANY_EXTENDED_KEY_USAGE = "2.5.29.37.0"; |
42 |
|
|
43 |
|
|
44 |
|
public static final String SERVER_AUTH = "1.3.6.1.5.5.7.3.1"; |
45 |
|
|
46 |
|
|
47 |
|
public static final String CLIENT_AUTH = "1.3.6.1.5.5.7.3.2"; |
48 |
|
|
49 |
|
|
50 |
|
public static final String CODE_SIGNING = "1.3.6.1.5.5.7.3.3"; |
51 |
|
|
52 |
|
|
53 |
|
public static final String EMAIL_PROTECTION = "1.3.6.1.5.5.7.3.4"; |
54 |
|
|
55 |
|
|
56 |
|
public static final String TIME_STAMPING = "1.3.6.1.5.5.7.3.8"; |
57 |
|
|
58 |
|
|
59 |
|
public static final String OCSP_SIGNING = "1.3.6.1.5.5.7.3.9"; |
60 |
|
|
61 |
|
private Set<String> usages = new HashSet<String>(); |
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
@param |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
2 |
public ExtendedKeyUsages(String[] usages)... |
69 |
|
{ |
70 |
2 |
Collections.addAll(this.usages, usages); |
71 |
|
} |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
@param |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
4 |
public ExtendedKeyUsages(Collection<String> usages)... |
79 |
|
{ |
80 |
4 |
this.usages.addAll(usages); |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
@param |
87 |
|
@return |
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
2 |
public boolean hasUsage(String usage)... |
90 |
|
{ |
91 |
2 |
return this.usages.contains(usage); |
92 |
|
} |
93 |
|
|
94 |
|
|
95 |
|
@return |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
97 |
4 |
public Set<String> getAll()... |
98 |
|
{ |
99 |
4 |
return Collections.unmodifiableSet(this.usages); |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
@return |
104 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
2 |
public boolean isEmpty()... |
106 |
|
{ |
107 |
2 |
return this.usages.isEmpty(); |
108 |
|
} |
109 |
|
} |