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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
package cz.crcs.ectester.standalone.libs.jni;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.Provider;
/**
* @author Jan Jancar johny@neuromancer.sk
*/
public abstract class NativeProvider extends Provider {
public NativeProvider(String name, double version, String info) {
super(name, version, info);
if (System.getSecurityManager() == null) {
setup();
} else {
AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
setup();
return null;
});
}
}
abstract void setup();
public static class TomCrypt extends NativeProvider {
public TomCrypt(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Botan extends NativeProvider {
public Botan(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Cryptopp extends NativeProvider {
public Cryptopp(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Openssl extends NativeProvider {
public Openssl(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Boringssl extends NativeProvider {
public Boringssl(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Gcrypt extends NativeProvider {
public Gcrypt(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class Mscng extends NativeProvider {
public Mscng(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
public static class MbedTLS extends NativeProvider {
public MbedTLS(String name, double version, String info) {
super(name, version, info);
}
@Override
native void setup();
}
}
|