1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.params.generator.asymmetric; |
21 |
|
|
22 |
|
import java.math.BigInteger; |
23 |
|
|
24 |
|
import org.xwiki.crypto.params.generator.KeyGenerationParameters; |
25 |
|
import org.xwiki.crypto.params.generator.symmetric.GenericKeyGenerationParameters; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 7 |
Complexity Density: 0.78 |
|
33 |
|
public class RSAKeyGenerationParameters extends GenericKeyGenerationParameters implements KeyGenerationParameters |
34 |
|
{ |
35 |
|
|
36 |
|
private static final BigInteger DEFAULT_PUBLIC_EXPONENT = BigInteger.valueOf(0x10001); |
37 |
|
|
38 |
|
|
39 |
|
private static final int DEFAULT_CERTAINTY = 12; |
40 |
|
|
41 |
|
|
42 |
|
private static final int DEFAULT_STRENGTH = 256; |
43 |
|
|
44 |
|
|
45 |
|
private final BigInteger publicExponent; |
46 |
|
|
47 |
|
|
48 |
|
private final int certainty; |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
@value |
54 |
|
|
55 |
|
@value |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
2 |
public RSAKeyGenerationParameters()... |
58 |
|
{ |
59 |
2 |
this(DEFAULT_STRENGTH); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
@value |
67 |
|
|
68 |
|
@param |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
4 |
public RSAKeyGenerationParameters(int strength)... |
71 |
|
{ |
72 |
4 |
this(strength, DEFAULT_PUBLIC_EXPONENT, DEFAULT_CERTAINTY); |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
@value |
79 |
|
|
80 |
|
@param |
81 |
|
@param |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
1 |
public RSAKeyGenerationParameters(int strength, BigInteger publicExponent)... |
84 |
|
{ |
85 |
1 |
this(strength, publicExponent, DEFAULT_CERTAINTY); |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
@param |
94 |
|
@param |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
1 |
public RSAKeyGenerationParameters(int strength, int certainty)... |
97 |
|
{ |
98 |
1 |
this(strength, DEFAULT_PUBLIC_EXPONENT, certainty); |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
@param |
105 |
|
@param |
106 |
|
@param |
107 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
108 |
6 |
public RSAKeyGenerationParameters(int strength, BigInteger publicExponent, int certainty)... |
109 |
|
{ |
110 |
6 |
super(strength); |
111 |
6 |
this.publicExponent = publicExponent; |
112 |
6 |
this.certainty = certainty; |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
@return |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
6 |
public BigInteger getPublicExponent()... |
119 |
|
{ |
120 |
6 |
return this.publicExponent; |
121 |
|
} |
122 |
|
|
123 |
|
|
124 |
|
@return |
125 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
6 |
public int getCertainty()... |
127 |
|
{ |
128 |
6 |
return this.certainty; |
129 |
|
} |
130 |
|
} |