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; |
21 |
|
|
22 |
|
import org.xwiki.crypto.pkix.params.CertificateGenerationParameters; |
23 |
|
import org.xwiki.crypto.pkix.params.x509certificate.extension.X509Extensions; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
@version |
29 |
|
@since |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 8 |
Complexity Density: 0.8 |
|
31 |
|
public class X509CertificateGenerationParameters implements CertificateGenerationParameters |
32 |
|
{ |
33 |
|
|
34 |
|
|
35 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
36 |
|
public enum Version |
37 |
|
{ |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
V1, |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
V2, |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
V3 |
52 |
|
} |
53 |
|
|
54 |
|
private static final int DEFAULT_VALIDITY = 500; |
55 |
|
|
56 |
|
private final Version version; |
57 |
|
|
58 |
|
private final int validity; |
59 |
|
|
60 |
|
private final X509Extensions extensions; |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
3 |
public X509CertificateGenerationParameters()... |
69 |
|
{ |
70 |
3 |
this(DEFAULT_VALIDITY); |
71 |
|
} |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
@param |
80 |
|
|
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
7 |
public X509CertificateGenerationParameters(X509Extensions extensions)... |
83 |
|
{ |
84 |
7 |
this(DEFAULT_VALIDITY, extensions); |
85 |
|
} |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
@param |
93 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
3 |
public X509CertificateGenerationParameters(int validity)... |
95 |
|
{ |
96 |
3 |
this(Version.V1, validity, null); |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
@param |
105 |
|
@param |
106 |
|
|
107 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
7 |
public X509CertificateGenerationParameters(int validity, X509Extensions extensions)... |
109 |
|
{ |
110 |
7 |
this(Version.V3, validity, extensions); |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
@param |
117 |
|
@param |
118 |
|
@param |
119 |
|
|
120 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
121 |
10 |
public X509CertificateGenerationParameters(Version version, int validity, X509Extensions extensions)... |
122 |
|
{ |
123 |
10 |
this.version = version; |
124 |
10 |
this.validity = validity; |
125 |
10 |
this.extensions = extensions; |
126 |
|
} |
127 |
|
|
128 |
|
|
129 |
|
@return |
130 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
131 |
10 |
public Version getX509Version()... |
132 |
|
{ |
133 |
10 |
return this.version; |
134 |
|
} |
135 |
|
|
136 |
|
|
137 |
|
@return |
138 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
10 |
public int getValidity()... |
140 |
|
{ |
141 |
10 |
return this.validity; |
142 |
|
} |
143 |
|
|
144 |
|
|
145 |
|
@return |
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
147 |
7 |
public X509Extensions getExtensions()... |
148 |
|
{ |
149 |
7 |
return this.extensions; |
150 |
|
} |
151 |
|
} |