1 |
|
package org.europa.together.business; |
2 |
|
|
3 |
|
import java.security.KeyPair; |
4 |
|
import java.security.NoSuchAlgorithmException; |
5 |
|
import java.security.PrivateKey; |
6 |
|
import java.security.PublicKey; |
7 |
|
import org.apiguardian.api.API; |
8 |
|
import static org.apiguardian.api.API.Status.STABLE; |
9 |
|
import org.europa.together.domain.CipherAlgorithm; |
10 |
|
import org.europa.together.domain.HashAlgorithm; |
11 |
|
import org.springframework.stereotype.Component; |
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
@author |
17 |
|
@version |
18 |
|
@since |
19 |
|
|
20 |
|
@API(status = STABLE, since = "2.0", consumers = "JavaCryptoTools") |
21 |
|
@Component |
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
22 |
|
public interface CryptoTools { |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@API(status = STABLE, since = "2.0") |
28 |
|
String FEATURE_ID = "CM-14"; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@param |
34 |
|
@param |
35 |
|
@return |
36 |
|
|
37 |
|
@API(status = STABLE, since = "2.0") |
38 |
|
String calculateHash(String plainText, HashAlgorithm algorithm); |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
@return |
46 |
|
@throws |
47 |
|
|
48 |
|
@API(status = STABLE, since = "2.1") |
49 |
|
int getMaxKeySize(CipherAlgorithm cipher) throws NoSuchAlgorithmException; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@param |
60 |
|
@return |
61 |
|
|
62 |
|
@API(status = STABLE, since = "2.1") |
63 |
|
KeyPair generateCipherKeyPair(CipherAlgorithm cipher); |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@param |
73 |
|
@param |
74 |
|
|
75 |
|
@API(status = STABLE, since = "2.1") |
76 |
|
void saveKeyPairToFile(String path, KeyPair keyRing); |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
@param |
83 |
|
@param |
84 |
|
@return |
85 |
|
|
86 |
|
@API(status = STABLE, since = "2.1") |
87 |
|
PrivateKey loadPrivateKeyFile(String keyFile, CipherAlgorithm algorithm); |
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
@param |
93 |
|
@param |
94 |
|
@return |
95 |
|
|
96 |
|
@API(status = STABLE, since = "2.1") |
97 |
|
PublicKey loadPublicKeyFile(String keyFile, CipherAlgorithm algorithm); |
98 |
|
} |