Changeset 1303 for trunk/src/org/expeditee/auth/AuthenticatorBrowser.java
- Timestamp:
- 04/11/19 15:42:27 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/AuthenticatorBrowser.java
r1287 r1303 78 78 79 79 private KeyStore keyStore = KeyStore.getInstance(KeystoreType); 80 public static String USER_NOBODY = "nobody"; 80 81 81 82 private static final byte[] TRUE = "yes".getBytes(); … … 95 96 96 97 public static boolean isAuthenticated() { 97 return isAuthenticationRequired() && !UserSettings.UserName.get().equals( Browser.USER_NOBODY);98 return isAuthenticationRequired() && !UserSettings.UserName.get().equals(AuthenticatorBrowser.USER_NOBODY); 98 99 } 99 100 … … 225 226 } 226 227 227 final void loadMailDatabase() throws SQLException, FileNotFoundException, ParseException {228 public final void loadMailDatabase() throws SQLException, FileNotFoundException, ParseException { 228 229 Path deadDropPath = Paths.get(FrameIO.DEAD_DROPS_PATH); 229 230 for (File connectionDir: deadDropPath.toFile().listFiles()) { … … 239 240 } 240 241 241 final void updateLastReadMailTime(Path deaddropforcontactPath) {242 public final void updateLastReadMailTime(Path deaddropforcontactPath) { 242 243 Path timestamp = deaddropforcontactPath.resolve(UserSettings.UserName.get() + ".last-accessed"); 243 244 try(FileWriter out = new FileWriter(timestamp.toFile())) { … … 304 305 } 305 306 306 final SecretKey getSecretKey(final String label, final String password) throws NoSuchAlgorithmException, KeyStoreException {307 public final SecretKey getSecretKey(final String label, final String password) throws NoSuchAlgorithmException, KeyStoreException { 307 308 308 309 char[] password_ca = password.toCharArray(); … … 318 319 } 319 320 320 final void putKey(final String label, final String password, final SecretKey key) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {321 public final void putKey(final String label, final String password, final SecretKey key) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException { 321 322 final KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(key); 322 323 final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(password.toCharArray()); … … 325 326 } 326 327 327 final boolean confirmIntergalaticNumber(final String username, final String email, final String intergalacticNumber) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException {328 public final boolean confirmIntergalaticNumber(final String username, final String email, final String intergalacticNumber) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException { 328 329 try { 329 330 final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray()); … … 341 342 } 342 343 343 final String newIntergalacticNumber(final String username, final String email) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {344 public final String newIntergalacticNumber(final String username, final String email) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException { 344 345 // generate intergalactic number 345 346 final SecureRandom rand = new SecureRandom(); … … 357 358 } 358 359 359 final PublicKey getPublicKey(String username) throws InvalidKeySpecException, NoSuchAlgorithmException, FileNotFoundException {360 public final PublicKey getPublicKey(String username) throws InvalidKeySpecException, NoSuchAlgorithmException, FileNotFoundException { 360 361 // load in frame with public key on it. 361 362 String credentialsFramesetPath = FrameIO.CONTACTS_PATH + username + "-credentials" + File.separator; … … 386 387 } 387 388 388 final void markRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {389 public final void markRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException { 389 390 KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(TRUE, SymmetricAlgorithm)); 390 391 KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(KeyList.PersonalKey.get().getText().toCharArray()); … … 393 394 } 394 395 395 final void clearRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {396 public final void clearRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException { 396 397 KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(FALSE, SymmetricAlgorithm)); 397 398 KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(KeyList.PersonalKey.get().getText().toCharArray()); … … 400 401 } 401 402 402 final boolean hasRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException {403 public final boolean hasRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException { 403 404 String alias = username + "colleaguesRequested"; 404 405 if (!keyStore.containsAlias(alias)) {
Note:
See TracChangeset
for help on using the changeset viewer.