equal
deleted
inserted
replaced
34 * @author Andreas Sterbenz |
34 * @author Andreas Sterbenz |
35 */ |
35 */ |
36 final class EphemeralKeyManager { |
36 final class EphemeralKeyManager { |
37 |
37 |
38 // indices for the keys array below |
38 // indices for the keys array below |
39 private final static int INDEX_RSA512 = 0; |
39 private static final int INDEX_RSA512 = 0; |
40 private final static int INDEX_RSA1024 = 1; |
40 private static final int INDEX_RSA1024 = 1; |
41 |
41 |
42 /* |
42 /* |
43 * Current cached RSA KeyPairs. Elements are never null. |
43 * Current cached RSA KeyPairs. Elements are never null. |
44 * Indexed via the constants above. |
44 * Indexed via the constants above. |
45 */ |
45 */ |
85 * Inner class to handle storage of ephemeral KeyPairs. |
85 * Inner class to handle storage of ephemeral KeyPairs. |
86 */ |
86 */ |
87 private static class EphemeralKeyPair { |
87 private static class EphemeralKeyPair { |
88 |
88 |
89 // maximum number of times a KeyPair is used |
89 // maximum number of times a KeyPair is used |
90 private final static int MAX_USE = 200; |
90 private static final int MAX_USE = 200; |
91 |
91 |
92 // maximum time interval in which the keypair is used (1 hour in ms) |
92 // maximum time interval in which the keypair is used (1 hour in ms) |
93 private final static long USE_INTERVAL = 3600*1000; |
93 private static final long USE_INTERVAL = 3600*1000; |
94 |
94 |
95 private KeyPair keyPair; |
95 private KeyPair keyPair; |
96 private int uses; |
96 private int uses; |
97 private long expirationTime; |
97 private long expirationTime; |
98 |
98 |