|
6 | 6 | import java.security.PrivateKey; |
7 | 7 | import java.security.PublicKey; |
8 | 8 |
|
9 | | -public interface BasicKeyStore { |
10 | | - String DEFAULT_RSA_ENCRYPTION_ALGORITHM = "RSA/ECB/PKCS1Padding"; |
11 | | - String DEFAULT_SYMMETRIC_KEY_TYPE = "AES"; |
12 | | - String DEFAULT_SYMMETRIC_ENCRYPTION_ALGORITHM = "AES/ECB/PKCS5Padding"; |
13 | | - // public static int DEFAULT_AES_KEY_SIZE = 256; |
14 | | - int DEFAULT_AES_KEY_SIZE = 128; // TODO we can do better |
15 | | - String DEFAULT_SIGNATURE_ALGORITHM = "SHA256withRSA"; |
16 | | - |
17 | | - /** |
18 | | - * |
19 | | - * @return private key of local device - for signing |
20 | | - * @throws ASAPSecurityException |
21 | | - */ |
22 | | - PrivateKey getPrivateKey() throws ASAPSecurityException; |
23 | | - |
24 | | - // debugging |
25 | | -// PrivateKey getPrivateKey(CharSequence subjectID) throws ASAPSecurityException; |
26 | | - |
| 9 | +public interface BasicKeyStore extends BasicCryptoSettings { |
27 | 10 | /** |
28 | | - * |
29 | 11 | * @param subjectID |
30 | 12 | * @return public key of recipient - to encrypt |
31 | 13 | * @throws ASAPSecurityException if key cannot be found |
32 | 14 | */ |
33 | 15 | PublicKey getPublicKey(CharSequence subjectID) throws ASAPSecurityException; |
34 | | - |
35 | | - /** |
36 | | - * @return public key of local device - for signing |
37 | | - * @throws ASAPSecurityException |
38 | | - */ |
39 | | - PublicKey getPublicKey() throws ASAPSecurityException; |
40 | | - |
41 | | - String getRSAEncryptionAlgorithm(); |
42 | | - |
43 | | - String getRSASigningAlgorithm(); |
44 | | - |
45 | | - SecretKey generateSymmetricKey() throws ASAPSecurityException; |
46 | | - |
47 | | - String getSymmetricEncryptionAlgorithm(); |
48 | | - |
49 | | - String getSymmetricKeyType(); |
50 | | - |
51 | | - int getSymmetricKeyLen(); |
52 | | - |
53 | | - /** |
54 | | - * |
55 | | - * @param peerID |
56 | | - * @return true if peerID is owners' id. |
57 | | - */ |
58 | | - boolean isOwner(CharSequence peerID); |
59 | | - |
60 | | - CharSequence getOwner(); |
61 | 16 | } |
0 commit comments