Ignore:
Timestamp:
04/11/19 15:42:27 (5 years ago)
Author:
bln4
Message:

Moved the static field USER_NOBODY to AuthenticatorBrowser from Browser as it makes more sense there.
Added functionality to log out, equiv to closing Expeditee and starting it again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/AuthenticatorBrowser.java

    r1287 r1303  
    7878       
    7979        private KeyStore keyStore = KeyStore.getInstance(KeystoreType);
     80        public static String USER_NOBODY = "nobody";
    8081               
    8182        private static final byte[] TRUE = "yes".getBytes();
     
    9596       
    9697        public static boolean isAuthenticated() {
    97                 return isAuthenticationRequired() && !UserSettings.UserName.get().equals(Browser.USER_NOBODY);
     98                return isAuthenticationRequired() && !UserSettings.UserName.get().equals(AuthenticatorBrowser.USER_NOBODY);
    9899        }
    99100       
     
    225226        }
    226227       
    227         final void loadMailDatabase() throws SQLException, FileNotFoundException, ParseException {
     228        public final void loadMailDatabase() throws SQLException, FileNotFoundException, ParseException {
    228229                Path deadDropPath = Paths.get(FrameIO.DEAD_DROPS_PATH);
    229230                for (File connectionDir: deadDropPath.toFile().listFiles()) {
     
    239240        }
    240241
    241         final void updateLastReadMailTime(Path deaddropforcontactPath) {
     242        public final void updateLastReadMailTime(Path deaddropforcontactPath) {
    242243                Path timestamp = deaddropforcontactPath.resolve(UserSettings.UserName.get() + ".last-accessed");
    243244                try(FileWriter out = new FileWriter(timestamp.toFile())) {
     
    304305        }
    305306         
    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 {     
    307308               
    308309                char[] password_ca = password.toCharArray();
     
    318319        }
    319320       
    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 {
    321322                final KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(key);
    322323                final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(password.toCharArray());
     
    325326        }
    326327       
    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 {
    328329                try {
    329330                        final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray());
     
    341342        }
    342343       
    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 {
    344345                // generate intergalactic number
    345346                final SecureRandom rand = new SecureRandom();
     
    357358        }
    358359       
    359         final PublicKey getPublicKey(String username) throws InvalidKeySpecException, NoSuchAlgorithmException, FileNotFoundException {
     360        public final PublicKey getPublicKey(String username) throws InvalidKeySpecException, NoSuchAlgorithmException, FileNotFoundException {
    360361                // load in frame with public key on it.
    361362                String credentialsFramesetPath = FrameIO.CONTACTS_PATH + username + "-credentials" + File.separator;
     
    386387        }
    387388       
    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 {
    389390                KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(TRUE, SymmetricAlgorithm));
    390391                KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(KeyList.PersonalKey.get().getText().toCharArray());
     
    393394        }
    394395       
    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 {
    396397                KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(FALSE, SymmetricAlgorithm));
    397398                KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(KeyList.PersonalKey.get().getText().toCharArray());
     
    400401        }
    401402       
    402         final boolean hasRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException {
     403        public final boolean hasRequestedColleagues(String username) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException {
    403404                String alias = username + "colleaguesRequested";
    404405                if (!keyStore.containsAlias(alias)) {
Note: See TracChangeset for help on using the changeset viewer.