- Timestamp:
- 05/17/19 14:37:12 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 3 added
- 2 deleted
- 10 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/Actions.java
r1362 r1363 23 23 import java.util.Collection; 24 24 import java.util.HashMap; 25 import java.util.Iterator;26 25 import java.util.List; 27 26 import java.util.Map; … … 39 38 import org.expeditee.agents.ExistingFramesetException; 40 39 import org.expeditee.agents.InvalidFramesetNameException; 41 import org.expeditee.auth.Mail.MailEntry;42 40 import org.expeditee.auth.account.Authenticate; 43 41 import org.expeditee.auth.account.Authenticate.AuthenticationResult; … … 45 43 import org.expeditee.auth.account.Create.CreateResult; 46 44 import org.expeditee.auth.account.Password; 47 import org.expeditee.auth.gui.MailBay; 45 import org.expeditee.auth.mail.Mail; 46 import org.expeditee.auth.mail.Mail.MailEntry; 47 import org.expeditee.auth.mail.gui.MailBay; 48 48 import org.expeditee.auth.tags.AuthenticationTag; 49 import org.expeditee.core.Colour;50 49 import org.expeditee.gio.gesture.StandardGestureActions; 51 50 import org.expeditee.gui.DisplayController; … … 56 55 import org.expeditee.items.Text; 57 56 import org.expeditee.settings.UserSettings; 58 import org.expeditee.settings.identity.passwordrecovery.Colleagues;59 57 import org.expeditee.settings.identity.secrets.KeyList; 60 58 import org.expeditee.stats.Formatter; … … 63 61 public class Actions implements CryptographyConstants { 64 62 65 // Debug Functions63 // Start Debug Actions 66 64 public static void SendTestMessage(String colleagueName) throws InvalidKeySpecException, NoSuchAlgorithmException, FileNotFoundException, KeyStoreException, CertificateException, ClassNotFoundException, IOException, SQLException { 67 65 String time = org.expeditee.stats.Formatter.getDateTime(); … … 75 73 MessageBay.displayMessage("Test message sent."); 76 74 } 75 77 76 public static void SendTestMessageHemi(String param) { 78 77 String time = Formatter.getDateTime(); … … 87 86 MessageBay.displayMessage("Test message sent."); 88 87 } 88 89 89 public static void SendTestOneOffMessage(String colleagueName) { 90 90 String time = Formatter.getDateTime(); … … 101 101 Mail.sendOneOffMail(mail, colleagueName, key); 102 102 } 103 public static void AuthOneOffSecureMessage(Text cursor, Text actionItem) {104 byte[] keyBytes = Base64.getDecoder().decode(cursor.getText());105 SecretKey key = new SecretKeySpec(keyBytes, SymmetricAlgorithm);106 List<String> data = actionItem.getData();107 String topic = new String(org.expeditee.auth.sharing.Actions.DecryptSymmetric(Base64.getDecoder().decode(data.get(3)), key));108 String message = new String(org.expeditee.auth.sharing.Actions.DecryptSymmetric(Base64.getDecoder().decode(data.get(4)), key));109 Map<String, String> options = new HashMap<String, String>();110 for (int i = 5; i < data.size(); i+=2) {111 String k = new String(org.expeditee.auth.sharing.Actions.DecryptSymmetric(Base64.getDecoder().decode(data.get(i)), key));112 String v = new String(org.expeditee.auth.sharing.Actions.DecryptSymmetric(Base64.getDecoder().decode(data.get(i + 1)), key));113 options.put(k, v);114 }115 MailBay.addMessage(data.get(0), topic, message, options);116 StandardGestureActions.Refresh();117 }118 public static void SetPWColleagues(String colleagueOne, String colleagueTwo) {119 Colleagues.Colleague_One.set(colleagueOne);120 Colleagues.Colleague_Two.set(colleagueTwo);121 Colleagues.Colleague_One_Email.set("[email protected]");122 Colleagues.Colleague_Two_Email.set("[email protected]");123 }124 103 125 104 private static String userbackup = "authadmin"; … … 128 107 UserSettings.UserName.set(userbackup); 129 108 userbackup = backup; 109 } 110 // End Debug Actions 111 112 // Start Misc Auth Actions 113 /** 114 * Action ran by user to read a message using a single use distributed Symmetric key 115 * @param cursor The content on the cursor should be a text item whose content is the 116 * Symmetric key to use, represented as a Base64 encoded string. 117 * @param actionItem The action item will contain the encrypted message in its data. 118 */ 119 public static void AuthOneOffSecureMessage(Text cursor, Text actionItem) { 120 byte[] keyBytes = Base64.getDecoder().decode(cursor.getText()); 121 SecretKey key = new SecretKeySpec(keyBytes, SymmetricAlgorithm); 122 List<String> data = actionItem.getData(); 123 Mail.decryptOneOffSecureMessage(key, data); 124 StandardGestureActions.Refresh(); 130 125 } 131 126 … … 166 161 } 167 162 163 /** 164 * Action used to navigate to multiuser1 (multiuser abilities) if authenticated and authentication1 (login) is not so. 165 */ 166 public static void AuthGotoAccountManagement() { 167 if (AuthenticatorBrowser.Authenticated) { 168 DisplayController.setCurrentFrame(FrameIO.LoadFrame("multiuser1"), false); 169 } else { 170 DisplayController.setCurrentFrame(FrameIO.LoadFrame("authentication1"), false); 171 } 172 } 173 174 /** 175 * Gets all items on a specified frame that contain the specified data. 176 */ 177 public static Collection<Item> getByData(Frame frame, String data) { 178 Collection<Item> allItems = frame.getAllItems(); 179 allItems.removeIf(i -> i.getData() == null || !i.hasData(data)); 180 return allItems; 181 } 182 183 /** 184 * Gets all items on a specified frame that contains the specified content. 185 */ 186 public static Collection<Item> getByContent(Frame frame, String content) { 187 Collection<Item> allItems = frame.getAllItems(); 188 allItems.removeIf(i -> i.getText().compareTo(content) != 0); 189 return allItems; 190 } 191 // End Misc Auth Actions 192 193 // Start Regain Account Access Actions 194 /** 195 * Action ran by user to specify who their password colleagues are. These are the 196 * individuals who will be consulted if and when the user needs to regain access 197 * to their account. 198 * @param colleagueOne 199 * @param colleagueTwo 200 */ 201 public static void AuthSetPWColleagues(String colleagueOne, String colleagueTwo) { 202 Password.setPWColleagues(colleagueOne, colleagueTwo); 203 } 204 205 /** 206 * Action ran by user to oblige with a request from colleague who has nominated the 207 * user as a pw colleague. Will email (not Expeditee mail) the colleague the password 208 * share that the user has stored on their secrets frame. 209 * @param colleagueName 210 */ 211 public static void AuthEmailPasswordShare(String colleagueName) { 212 Password.emailPasswordShare(colleagueName); 213 } 214 215 /** 216 * Action ran by user to regain access to their account by providing: 217 * their username 218 * two password shares obtained from pw colleagues 219 * their desired new password 220 */ 221 public static void AuthRegainAccountAccess() { 222 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); 223 Optional<Map<AuthenticationTag, String>> userdata = AuthenticationTag.fetchUserData(textItems, false, 224 AuthenticationTag.Username, AuthenticationTag.NewPassword, AuthenticationTag.NewPasswordAgain, 225 AuthenticationTag.PasswordSliceOne, AuthenticationTag.PasswordSliceTwo); 226 if (userdata.isPresent()) { 227 // Confirm new requested passwords match 228 Map<AuthenticationTag, String> userData = userdata.get(); 229 if (!userData.get(AuthenticationTag.NewPassword).equals(userData.get(AuthenticationTag.NewPasswordAgain))) { 230 return; 231 } 232 233 Password.regainAccountAccess(userData); 234 } 235 } 236 237 /** 238 * Actions used to generate and deliver an intergalactic number to a users public email 239 * address after they have began the password recovery process. 240 */ 241 public static void AuthDistributeIntergalacticNumber() { 242 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); 243 Optional<Map<AuthenticationTag, String>> userdata = 244 AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username); 245 if (userdata.isPresent()) { 246 Map<AuthenticationTag, String> userData = userdata.get(); 247 String username = userData.get(AuthenticationTag.Username); 248 String email = getEmailFromUsername(username); 249 userData.put(AuthenticationTag.Email, email); 250 Password.generateAndDeliverIntergalacticNumber(userData); 251 MessageBay.displayMessage("A identity number has been sent to the email " 252 + "associated with your account. Enter it below to proceed."); 253 } 254 } 255 256 /** 257 * Action used by user to submit their intergalactic number along with their username 258 * in order to confirm that they own the public email address registered to their account. 259 * This is part of the process of recoverying access to an account. 260 */ 261 public static void AuthSubmitIntergalacticNumber() { 262 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); 263 Optional<Map<AuthenticationTag, String>> userdata = 264 AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, 265 AuthenticationTag.IntergalacticNumber); 266 if (userdata.isPresent()) { 267 Password.confirmIntergalacticNumberAndAlertColleagues(userdata.get()); 268 } 269 } 270 // End Regain Account Access Actions 271 272 // Start Create Account Actions 168 273 /** 169 274 * Action used to created a new user account. … … 235 340 } 236 341 } 237 342 // End Create Account Actions 343 344 // Start Account Login Actions 238 345 /** 239 346 * Action used to start authentication as a specified user. … … 258 365 } 259 366 367 /** 368 * Action used by the user to log out of their account. 369 */ 260 370 public static void AuthLogout() { 261 371 MessageBay.displayMessage(Authenticate.logout().toString()); 262 372 } 263 373 // End Account Login Actions 374 375 // Start Change Access Actions 264 376 /** 265 377 * Action used to change the currently authenticated users password. … … 295 407 } 296 408 } 297 298 public static void AuthGotoAccountManagement() { 299 if (AuthenticatorBrowser.Authenticated) { 300 DisplayController.setCurrentFrame(FrameIO.LoadFrame("multiuser1"), false); 301 } else { 302 DisplayController.setCurrentFrame(FrameIO.LoadFrame("authentication1"), false); 303 } 304 } 305 306 public static void AuthDistributeIntergalacticNumber() { 307 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); 308 Optional<Map<AuthenticationTag, String>> userdata = 309 AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username); 310 if (userdata.isPresent()) { 311 Map<AuthenticationTag, String> userData = userdata.get(); 312 String username = userData.get(AuthenticationTag.Username); 313 String email = getEmailFromUsername(username); 314 userData.put(AuthenticationTag.Email, email); 315 Password.generateAndDeliverIntergalacticNumber(userData); 316 MessageBay.displayMessage("A identity number has been sent to the email " 317 + "associated with your account. Enter it below to proceed."); 318 } 319 } 320 321 public static void AuthSubmitIntergalacticNumber() { 322 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); 323 Optional<Map<AuthenticationTag, String>> userdata = 324 AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, 325 AuthenticationTag.IntergalacticNumber); 326 if (userdata.isPresent()) { 327 Map<AuthenticationTag, String> tags = userdata.get(); 328 String username = tags.get(AuthenticationTag.Username); 329 String intergalacticNumber = tags.get(AuthenticationTag.IntergalacticNumber); 330 boolean match = false; 331 try { 332 match = AuthenticatorBrowser.getInstance().confirmIntergalaticNumber(username, intergalacticNumber); 333 } catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | ClassNotFoundException 334 | IOException | SQLException e) { 335 e.printStackTrace(); 336 return; 337 } 338 if (!match) { 339 MessageBay.errorMessage("The provided identity number does not match the one stored on file."); 340 return; 341 } 342 String[] colleagues = getPasswordColleaguesFromUsername(username); 343 Password.confirmIntergalacticNumberAndAlertColleagues(userdata.get(), colleagues); 344 } 345 } 346 409 // End Change Access Actions 410 411 // Start Private Helper Functions. 412 /** 413 * Gets the public email address associated with the specified username. 414 * @param username 415 * @return 416 */ 347 417 private static String getEmailFromUsername(String username) { 348 418 Path credentialsDirPath = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve(username + "-credentials"); … … 374 444 } 375 445 } 376 377 private static String[] getPasswordColleaguesFromUsername(String username) { 378 Path credentialsDirPath = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve(username + "-credentials"); 379 Path credentialsFilePath = credentialsDirPath.resolve("pwcolleagues.inf"); 380 String fileName = null; 381 if (credentialsFilePath.toFile().exists()) { 382 try (Scanner in = new Scanner(credentialsFilePath)) { 383 fileName = in.nextLine(); 384 } catch (IOException e) { 385 MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?"); 386 return null; 387 } 388 } else { 389 MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?"); 390 return null; 391 } 392 393 int number = Integer.parseInt(fileName.replace(".exp", "")); 394 Frame pwColleagueFrame = FrameIO.LoadFrame(username + number, FrameIO.PROFILE_PATH); 395 Collection<Text> textItems = pwColleagueFrame.getTextItems(); 396 textItems.removeIf(text -> !text.getText().startsWith("Colleague")); 397 398 String[] ret = new String[4]; 399 Iterator<Text> it = textItems.iterator(); 400 while(it.hasNext()) { 401 String content = it.next().getText().toLowerCase().trim(); 402 if (content.contains("colleague_one:")) { 403 ret[0] = content.replace("colleague_one:", "").trim(); 404 } else if (content.contains("colleague_two:")) { 405 ret[1] = content.replace("colleague_two:", "").trim(); 406 } else if (content.contains("colleague_one_email:")) { 407 ret[2] = content.replace("colleague_one_email:", "").trim(); 408 } else if (content.contains("colleague_two_email:")) { 409 ret[3] = content.replace("colleague_two_email:", "").trim(); 410 } 411 } 412 return ret; 413 } 414 446 // End Private Helper Functions. 447 448 // Start Future Functionality 415 449 public static void AuthShareFrameset() throws IOException { 416 450 Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems(); … … 431 465 } 432 466 } 433 434 /** 435 * Navigation action for progressing the process of recruiting colleagues to assist in password recovery. 436 * Hides certain content that AuthSubmitPWCollegues goes onto show if it does not fail. 437 */ 438 public static void AuthGotoColleagueSubmissionFrame() { 439 Frame destination = FrameIO.LoadFrame("authentication7"); 440 DisplayController.setCurrentFrame(destination, true); 441 Collection<Item> toHide = getByData(destination, "ShowOnProgress"); 442 for (Item i: toHide) { 443 i.setVisible(false); 444 } 467 468 /* 469 * Function to share a specified frameset. 470 * Currently, this moves the frameset to the 'Shared By Me' directory and then relies on the user to use Google Drive functionality to share it appropriately. 471 */ 472 private static void shareFrameset(Frame toShare) throws IOException { 473 File destinationDir = new File(FrameIO.SHARED_FRAMESETS_PATH + File.separator + toShare.getFramesetName()); 474 File sourceDir = new File(toShare.getFramesetPath()); 475 476 if (destinationDir.exists()) { 477 MessageBay.errorMessage("A frameset by this name already exists."); 478 return; 479 } 480 481 destinationDir.mkdir(); 482 List<Path> files = Files.walk(sourceDir.toPath()).collect(Collectors.toList()); 483 Files.move(files.get(0), destinationDir.toPath(), StandardCopyOption.ATOMIC_MOVE); 484 485 MessageBay.displayMessage("The frameset " + toShare.getFramesetName() + " has been moved to " + destinationDir + ". Google Drive functionality can now be used to share it with colleagues."); 445 486 } 446 487 … … 493 534 } 494 535 495 // public static void AuthSetupPasswordRecovery() throws KeyStoreException, FileNotFoundException, NoSuchAlgorithmException, CertificateException, ClassNotFoundException, IOException, SQLException, UnrecoverableEntryException {496 // if (!UserSettings.Authenticated.get()) {497 // MessageBay.errorMessage("You must be logged in to perform this action.");498 // } else if (!Authenticator.getInstance().hasRegisteredEmail(UserSettings.UserName.get())) {499 // Frame registerEmailFrame = FrameIO.LoadFrame("authentication4");500 // DisplayController.setCurrentFrame(registerEmailFrame, true);501 // } else if (!Authenticator.getInstance().hasRequestedColleagues(UserSettings.UserName.get()) && Authenticator.getInstance().getColleagues(UserSettings.UserName.get()) == null) {502 // Frame submitColleaguesFrame = FrameIO.LoadFrame("authentication5");503 // DisplayController.setCurrentFrame(submitColleaguesFrame, true);504 // } else if (Authenticator.getInstance().hasRequestedColleagues(UserSettings.UserName.get()) && Authenticator.getInstance().getColleagues(UserSettings.UserName.get()) == null) {505 // MessageBay.displayMessage("You have already nominated two colleagues to assist you in the process of password recovery and are awaiting their response."506 // + " You will be alerted on Expeditee startup when they have both responded.");507 // } else if (Authenticator.getInstance().getColleagues(UserSettings.UserName.get()) != null) {508 // MessageBay.displayMessage("You have completed the Password Recovery Setup process, there is nothing more to do here.");509 // }510 // }511 512 public static void AuthConfirmPasswordColleagueRelationship(String colleagueName) {513 514 }515 516 public static void AuthDenyPasswordColleagueRelationship(String colleagueName) throws InvalidKeySpecException, NoSuchAlgorithmException,517 KeyStoreException, FileNotFoundException, CertificateException, ClassNotFoundException, IOException, SQLException {518 denyPasswordColleagueRelationship(colleagueName);519 }520 521 public static void AuthClearPWColleaguesNominated() {522 523 }524 525 536 /* 526 * Function to share a specified frameset. 527 * Currently, this moves the frameset to the 'Shared By Me' directory and then relies on the user to use Google Drive functionality to share it appropriately. 528 */ 529 private static void shareFrameset(Frame toShare) throws IOException { 530 File destinationDir = new File(FrameIO.SHARED_FRAMESETS_PATH + File.separator + toShare.getFramesetName()); 531 File sourceDir = new File(toShare.getFramesetPath()); 532 533 if (destinationDir.exists()) { 534 MessageBay.errorMessage("A frameset by this name already exists."); 535 return; 536 } 537 538 destinationDir.mkdir(); 539 List<Path> files = Files.walk(sourceDir.toPath()).collect(Collectors.toList()); 540 Files.move(files.get(0), destinationDir.toPath(), StandardCopyOption.ATOMIC_MOVE); 541 542 MessageBay.displayMessage("The frameset " + toShare.getFramesetName() + " has been moved to " + destinationDir + ". Google Drive functionality can now be used to share it with colleagues."); 543 } 544 545 private static void denyPasswordColleagueRelationship(String colleagueName) throws InvalidKeySpecException, NoSuchAlgorithmException, KeyStoreException, FileNotFoundException, CertificateException, ClassNotFoundException, IOException, SQLException { 546 String time = org.expeditee.stats.Formatter.getDateTime(); 547 String sender = UserSettings.UserName.get(); 548 String message = "You have received a reply from " + sender + " reguarding your request for assistance."; 549 String message2 = "Unfortunately " + sender + " has indicated that they are unable to help you with your potential password recovery."; 550 Map<String, String> options = new HashMap<String, String>(); 551 options.put("Clear Preview Colleague Nominations", "AuthClearPWColleaguesNominated"); 552 MailEntry mail = new MailEntry(time, sender, colleagueName, message, message2, options); 553 Mail.sendMail(mail, colleagueName); 554 } 555 537 * Function to submit a request to specified contacts to be the current users pw colleagues. 538 */ 556 539 private static boolean submitPWColleagues(Map<AuthenticationTag, String> userData) throws InvalidKeySpecException, NoSuchAlgorithmException, KeyStoreException, FileNotFoundException, CertificateException, ClassNotFoundException, IOException, SQLException { 557 540 String colleagueOne = userData.get(AuthenticationTag.ColleagueOne); … … 581 564 } 582 565 } 583 584 public static void TickBox(final Text item) { 585 if (item.getBackgroundColor() != Colour.RED) { 586 item.setBackgroundColor(Colour.RED); 587 } else { 588 item.setBackgroundColor(Colour.GREEN); 589 } 590 } 591 592 /* 593 * Gets all items on a specified frame that contain the specified data. 594 */ 595 public static Collection<Item> getByData(final Frame frame, final String data) { 596 final Collection<Item> allItems = frame.getAllItems(); 597 allItems.removeIf(i -> i.getData() == null || !i.hasData(data)); 598 return allItems; 599 } 600 601 public static Collection<Item> getByContent(final Frame frame, final String content) { 602 final Collection<Item> allItems = frame.getAllItems(); 603 allItems.removeIf(i -> i.getText().compareTo(content) != 0); 604 return allItems; 605 } 566 // End Future Functionality 606 567 } -
trunk/src/org/expeditee/auth/AuthenticatorBrowser.java
r1362 r1363 44 44 45 45 import org.expeditee.actions.Actions; 46 import org.expeditee.auth.mail.Mail; 46 47 import org.expeditee.core.Dimension; 47 48 import org.expeditee.core.Point; … … 73 74 public static int CREDENTIALS_FRAME = -1; 74 75 public static int PASSWORD_RECOVERY_FRAME = -1; 76 public static int SECRETS_FRAME = -1; 75 77 public static final String ADMINACCOUNT = "authadmin"; 76 78 public static final String PROFILEENCRYPTIONLABEL = "Profile"; … … 107 109 loadKeystore(); 108 110 Actions.LoadMethods(org.expeditee.auth.Actions.class); 109 Actions.LoadMethods(org.expeditee. auth.sharing.Actions.class);111 Actions.LoadMethods(org.expeditee.encryption.Actions.class); 110 112 111 113 // Does the account Authentication.ADMINACCOUNT exist? … … 351 353 // generate intergalactic number 352 354 SecureRandom rand = new SecureRandom(); 353 byte[] intergalacticNumberBytes = new byte[1 0];355 byte[] intergalacticNumberBytes = new byte[16]; 354 356 rand.nextBytes(intergalacticNumberBytes); 355 357 String intergalacticNumber = Base64.getEncoder().encodeToString(intergalacticNumberBytes); -
trunk/src/org/expeditee/auth/account/Authenticate.java
r1359 r1363 25 25 import org.expeditee.auth.Actions; 26 26 import org.expeditee.auth.AuthenticatorBrowser; 27 import org.expeditee.auth. gui.MailBay;27 import org.expeditee.auth.mail.gui.MailBay; 28 28 import org.expeditee.auth.tags.AuthenticationTag; 29 29 import org.expeditee.gui.Browser; … … 41 41 public class Authenticate implements CryptographyConstants { 42 42 43 /** 44 * Given a username and password, potentially login. 45 * @param userdata 46 * @return AuthenticationResult.SuccessLogin if login works, AuthenticationResult.ErrorLoginNobody or AuthenticationResult.ErrorLoginUsernamePasswordCombo otherwise. 47 */ 43 48 public static AuthenticationResult login(Map<AuthenticationTag, String> userdata) { 44 49 String username = userdata.get(AuthenticationTag.Username); … … 76 81 if(data != null && data.contains("MultiuserCredentials")) { 77 82 AuthenticatorBrowser.CREDENTIALS_FRAME = f.getNumber(); 83 } else if (data != null && data.contains("PasswordColleagues")) { 84 AuthenticatorBrowser.PASSWORD_RECOVERY_FRAME = f.getNumber(); 85 } else if (data != null && data.contains("SecretsFrame")) { 86 AuthenticatorBrowser.SECRETS_FRAME = f.getNumber(); 78 87 } 79 }88 } 80 89 } 81 90 … … 103 112 byte[] keyBytes = Base64.getDecoder().decode(keyEncoded); 104 113 PrivateKey key = KeyFactory.getInstance(AsymmetricAlgorithm).generatePrivate(new PKCS8EncodedKeySpec(keyBytes)); 105 org.expeditee.auth. Mail.checkMail(key);114 org.expeditee.auth.mail.Mail.checkMail(key); 106 115 } else { 107 116 res.additionalInfo.add("No private key present: your communication with other Expeditee users will be limited until this is resolved."); … … 129 138 } 130 139 140 /** 141 * Logs out the current authenticated user. 142 * @return AuthenticationResult.SuccessLogout to signal the logout has occured. 143 */ 131 144 public static AuthenticationResult logout() { 132 145 // Set user to nobody. -
trunk/src/org/expeditee/auth/account/Create.java
r1356 r1363 125 125 return CreateResult.SuccessCreateAccount; 126 126 } 127 128 public static CreateResult createAlternativeAccess(Map<AuthenticationTag, String> userdata) { 129 String username = userdata.get(AuthenticationTag.Username); 130 FrameIO.CreateFrame(username, null, "default1"); 131 return null; 132 } 133 127 134 128 public enum CreateResult { 135 129 SuccessCreateAccount ("Account created."), … … 193 187 FrameIO.migrateFrame(credentialsFrame, destinationFile); 194 188 // pwcolleagues.inf file. 195 String pwColleaguesPath = credentialsDir.getAbsolutePath() + File.separator + "pwcolleagues.inf"; 196 File pwColleaguesFile = new File(pwColleaguesPath); 189 File pwColleaguesFile = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve("pwcolleagues.inf").toFile(); 197 190 pwColleaguesFile.createNewFile(); 198 191 out = new FileWriter(pwColleaguesFile); … … 234 227 } 235 228 }); 236 notifiers.put("settings.identity.passwordrecovery", frame -> { 229 notifiers.put("settings.identity.passwordrecovery", frame -> { 230 frame.addToData("PasswordColleagues"); 237 231 AuthenticatorBrowser.PASSWORD_RECOVERY_FRAME = frame.getNumber(); 238 232 }); 239 233 notifiers.put("settings.identity.secrets", frame -> { 234 frame.addToData("SecretsFrame"); 235 AuthenticatorBrowser.SECRETS_FRAME = frame.getNumber(); 236 }); 240 237 241 238 // Create users profile -
trunk/src/org/expeditee/auth/account/Password.java
r1357 r1363 1 1 package org.expeditee.auth.account; 2 2 3 import java.io.File; 3 4 import java.io.FileNotFoundException; 4 5 import java.io.IOException; 6 import java.nio.file.Path; 7 import java.nio.file.Paths; 5 8 import java.security.KeyStoreException; 6 9 import java.security.NoSuchAlgorithmException; 10 import java.security.SecureRandom; 7 11 import java.security.cert.CertificateException; 8 12 import java.sql.SQLException; 13 import java.util.Base64; 14 import java.util.Collection; 15 import java.util.HashMap; 16 import java.util.Iterator; 9 17 import java.util.Map; 10 18 import java.util.Properties; 19 import java.util.Scanner; 11 20 12 21 import javax.crypto.SecretKey; 22 import javax.crypto.spec.SecretKeySpec; 13 23 import javax.mail.Message; 14 24 import javax.mail.MessagingException; … … 16 26 import javax.mail.Session; 17 27 import javax.mail.Transport; 28 import javax.mail.internet.AddressException; 18 29 import javax.mail.internet.InternetAddress; 19 30 import javax.mail.internet.MimeMessage; 20 31 21 32 import org.expeditee.auth.AuthenticatorBrowser; 33 import org.expeditee.auth.mail.Mail; 34 import org.expeditee.auth.mail.Mail.MailEntry; 22 35 import org.expeditee.auth.tags.AuthenticationTag; 23 36 import org.expeditee.gui.DisplayController; 37 import org.expeditee.gui.Frame; 24 38 import org.expeditee.gui.FrameIO; 25 39 import org.expeditee.gui.MessageBay; 40 import org.expeditee.items.Text; 41 import org.expeditee.settings.UserSettings; 42 import org.expeditee.settings.identity.passwordrecovery.Colleagues; 43 import org.expeditee.settings.identity.secrets.KeyList; 44 import org.expeditee.stats.Formatter; 26 45 import org.ngikm.cryptography.CryptographyConstants; 27 46 47 import com.codahale.shamir.Scheme; 48 28 49 public class Password implements CryptographyConstants { 29 /* 30 * Changes the recorded password for a user in the key store .50 /** 51 * Changes the recorded password for a user in the key store; given the username signaling whose password to change, along with the existing and new password. 31 52 */ 32 53 public static void changePassword(Map<AuthenticationTag, String> userdata) throws NoSuchAlgorithmException, KeyStoreException, FileNotFoundException, CertificateException, IOException, ClassNotFoundException, SQLException { … … 45 66 } 46 67 68 /** 69 * Generates a intergalaictic number for a specified user and emails that number using the specified email. 70 * @param userData 71 */ 47 72 public static void generateAndDeliverIntergalacticNumber(Map<AuthenticationTag, String> userData) { 48 73 String username = userData.get(AuthenticationTag.Username); … … 57 82 sb.append("If it was you who made this request, the following string of characters is your intergalactic number: " + intergalacticNumber + nl); 58 83 59 // Establish properties for email. 60 Properties properties = System.getProperties(); 61 properties.setProperty("mail.transport.protocol", "smtp"); 62 properties.setProperty("mail.smtp.host", "smtp.gmail.com"); 63 properties.setProperty("mail.smtp.port", "465"); 64 properties.setProperty("mail.smtp.starttls.enable", "true"); 65 properties.setProperty("mail.smtp.auth", "true"); 66 properties.setProperty("mail.smtp.debug", "true"); 67 properties.setProperty("mail.smtp.auth", "true"); 68 properties.setProperty("mail.smtp.socketFactory.port", "465"); 69 properties.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); 70 properties.setProperty("mail.smtp.socketFactory.fallback", "false"); 71 72 Session session = Session.getDefaultInstance(properties, new javax.mail.Authenticator() { 73 @Override 74 protected PasswordAuthentication getPasswordAuthentication() { 75 return new PasswordAuthentication("noreply.expeditee", "intergalacticnumber"); 76 }; 77 }); 78 79 // construct email message 80 final MimeMessage message = new MimeMessage(session); 81 message.setFrom(new InternetAddress("[email protected]")); 82 message.addRecipient(Message.RecipientType.TO, new InternetAddress(email)); 83 message.setSubject("Expeditee Password Recovery"); 84 message.setText(sb.toString()); 85 86 // send email message 87 Transport.send(message); 84 sendEmail(email, sb); 88 85 } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | ClassNotFoundException 89 86 | IOException | SQLException | MessagingException e) { … … 92 89 } 93 90 94 public static void confirmIntergalacticNumberAndAlertColleagues(Map<AuthenticationTag, String> userData, String[] colleagues) { 95 System.err.println("Colleague One: " + colleagues[0] + " @" + colleagues[2]); 96 System.err.println("Colleague Two: " + colleagues[1] + " @" + colleagues[3]); 91 /** 92 * Confirms that the specified intergalaictic number matches the one of file for the specified username. 93 * Passing this test it then alerts the users pw colleagues through a one-off secure Expeditee message. 94 * @param tags 95 */ 96 public static void confirmIntergalacticNumberAndAlertColleagues(Map<AuthenticationTag, String> tags) { 97 // Confirm intergalactic numbers match 98 String username = tags.get(AuthenticationTag.Username); 99 String intergalacticNumber = tags.get(AuthenticationTag.IntergalacticNumber); 100 boolean match = false; 101 try { 102 match = AuthenticatorBrowser.getInstance().confirmIntergalaticNumber(username, intergalacticNumber); 103 } catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | ClassNotFoundException 104 | IOException | SQLException e) { 105 e.printStackTrace(); 106 return; 107 } 108 if (!match) { 109 MessageBay.errorMessage("The provided identity number does not match the one stored on file."); 110 return; 111 } 112 113 // Get colleagues to distribute messages too. 114 String[] colleagues = getPasswordColleaguesFromUsername(username); 115 // Send secure message to colleague one 116 String colleagueOne = colleagues[0]; 117 String time = Formatter.getDateTime(); 118 String topic = "Password Recovery for " + username; 119 String message = "Your colleague " + username + " would like you to help them recover access to their account."; 120 Map<String, String> options = new HashMap<String, String>(); 121 options.put("Provide assistance", "AuthEmailPasswordShare " + username); 122 MailEntry mail = new MailEntry(time, username, colleagueOne, topic, message, options); 123 Mail.sendOneOffMail(mail, colleagueOne, Base64.getDecoder().decode(intergalacticNumber)); 124 125 // Send secure message to colleague two 126 String colleagueTwo = colleagues[1]; 127 Mail.sendOneOffMail(mail, colleagueTwo, Base64.getDecoder().decode(intergalacticNumber)); 128 129 String nl = System.getProperty("line.separator"); 130 StringBuilder sb = new StringBuilder(); 131 sb.append("You are receiving this email because one of your Expeditee contacts has sent you a one-off secure message." + nl); 132 sb.append("When you log into Expeditee and check your mail it will be there waiting for you." + nl); 133 sb.append("You will need the following key to read this message: " + nl); 134 sb.append(intergalacticNumber); 135 try { 136 // Send email with key to colleague one 137 String colleagueOneEmail = colleagues[2]; 138 sendEmail(colleagueOneEmail, sb); 139 // Send email with key to colleague two 140 String colleagueTwoEmail = colleagues[3]; 141 sendEmail(colleagueTwoEmail, sb); 142 } catch (MessagingException e) { 143 e.printStackTrace(); 144 } 145 } 146 147 private static String[] getPasswordColleaguesFromUsername(String username) { 148 Path credentialsFilePath = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve("pwcolleagues.inf"); 149 String fileName = null; 150 if (credentialsFilePath.toFile().exists()) { 151 try (Scanner in = new Scanner(credentialsFilePath)) { 152 fileName = in.nextLine(); 153 } catch (IOException e) { 154 MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?"); 155 return null; 156 } 157 } else { 158 MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?"); 159 return null; 160 } 161 162 int number = Integer.parseInt(fileName.replace(".exp", "")); 163 Frame pwColleagueFrame = FrameIO.LoadFrame(username + number, FrameIO.PROFILE_PATH); 164 Collection<Text> textItems = pwColleagueFrame.getTextItems(); 165 textItems.removeIf(text -> !text.getText().startsWith("Colleague")); 166 167 String[] ret = new String[4]; 168 Iterator<Text> it = textItems.iterator(); 169 while(it.hasNext()) { 170 String content = it.next().getText().toLowerCase().trim(); 171 if (content.contains("colleague_one:")) { 172 ret[0] = content.replace("colleague_one:", "").trim(); 173 } else if (content.contains("colleague_two:")) { 174 ret[1] = content.replace("colleague_two:", "").trim(); 175 } 176 } 177 178 // find colleague one email 179 Path credentialsDirectoryPath = UserSettings.PublicAndPrivateResources 180 ? Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username) 181 : Paths.get(FrameIO.PARENT_FOLDER); 182 credentialsDirectoryPath = credentialsDirectoryPath.resolve("contacts").resolve(ret[0] + "-credentials"); 183 try (Scanner in = new Scanner(credentialsDirectoryPath.resolve("credentials.inf").toFile())) { 184 int parseInt = Integer.parseInt(in.nextLine().replace(".exp", "")); 185 Frame frame = FrameIO.LoadFrame(ret[0] + "-credentials" + parseInt, credentialsDirectoryPath.toAbsolutePath().getParent().toString() + File.separator); 186 textItems = frame.getTextItems(); 187 textItems.removeIf(text -> !text.getText().startsWith("Email:")); 188 ret[2] = textItems.iterator().next().getText().replace("Email:", "").trim(); 189 } catch (FileNotFoundException e) { 190 MessageBay.errorMessage("You do not appear to have contact with your nominated password colleague: " + ret[0]); 191 return null; 192 } 193 194 195 // find colleague two email 196 credentialsDirectoryPath = UserSettings.PublicAndPrivateResources 197 ? Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username) 198 : Paths.get(FrameIO.PARENT_FOLDER); 199 credentialsDirectoryPath = credentialsDirectoryPath.resolve("contacts").resolve(ret[1] + "-credentials"); 200 try (Scanner in = new Scanner(credentialsDirectoryPath.resolve("credentials.inf").toFile())) { 201 int parseInt = Integer.parseInt(in.nextLine().replace(".exp", "")); 202 Frame frame = FrameIO.LoadFrame(ret[1] + "-credentials" + parseInt, credentialsDirectoryPath.toAbsolutePath().getParent().toString() + File.separator); 203 textItems = frame.getTextItems(); 204 textItems.removeIf(text -> !text.getText().startsWith("Email:")); 205 ret[3] = textItems.iterator().next().getText().replace("Email:", "").trim(); 206 } catch (FileNotFoundException e) { 207 MessageBay.errorMessage("You do not appear to have contact with your nominated password colleague: " + ret[1]); 208 return null; 209 } 210 211 return ret; 212 } 213 214 215 public static void sendEmail(String email, StringBuilder sb) throws MessagingException, AddressException { 216 // Establish properties for email. 217 Properties properties = System.getProperties(); 218 properties.setProperty("mail.transport.protocol", "smtp"); 219 properties.setProperty("mail.smtp.host", "smtp.gmail.com"); 220 properties.setProperty("mail.smtp.port", "465"); 221 properties.setProperty("mail.smtp.starttls.enable", "true"); 222 properties.setProperty("mail.smtp.auth", "true"); 223 properties.setProperty("mail.smtp.debug", "true"); 224 properties.setProperty("mail.smtp.auth", "true"); 225 properties.setProperty("mail.smtp.socketFactory.port", "465"); 226 properties.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); 227 properties.setProperty("mail.smtp.socketFactory.fallback", "false"); 228 229 Session session = Session.getDefaultInstance(properties, new javax.mail.Authenticator() { 230 @Override 231 protected PasswordAuthentication getPasswordAuthentication() { 232 return new PasswordAuthentication("noreply.expeditee", "intergalacticnumber"); 233 }; 234 }); 235 236 // construct email message 237 final MimeMessage message = new MimeMessage(session); 238 message.setFrom(new InternetAddress("[email protected]")); 239 message.addRecipient(Message.RecipientType.TO, new InternetAddress(email)); 240 message.setSubject("Expeditee Password Recovery"); 241 message.setText(sb.toString()); 242 243 // send email message 244 Transport.send(message); 245 } 246 247 public static void setPWColleagues(String colleagueOne, String colleagueTwo) { 248 // Get needed text items. 249 Frame pwRecoveryFrame = FrameIO.LoadFrame(UserSettings.UserName.get() + AuthenticatorBrowser.PASSWORD_RECOVERY_FRAME); 250 Collection<Text> textItems = pwRecoveryFrame.getTextItems(); 251 textItems.removeIf(t -> !t.getText().toLowerCase().startsWith("colleague")); 252 253 // Find colleague one and two text items. Set appropriate values. 254 Iterator<Text> it = textItems.iterator(); 255 while (it.hasNext()) { 256 Text text = it.next(); 257 if (text.getText().toLowerCase().startsWith("colleague_one:")) { 258 text.setText("Colleague_one: " + colleagueOne); 259 Colleagues.Colleague_One.set(colleagueOne); 260 } else if (text.getText().toLowerCase().startsWith("colleague_two:")) { 261 text.setText("Colleague_two:" + colleagueTwo); 262 Colleagues.Colleague_Two.set(colleagueTwo); 263 } 264 } 265 FrameIO.ForceSaveFrame(pwRecoveryFrame); 266 267 // Key to split and distribute 268 String fullKey = KeyList.PersonalKey.get().getData().get(0); 269 byte[] keyBytes = Base64.getDecoder().decode(fullKey); 270 271 // Initialise Shamir 272 int totalShares = 2; 273 int requiredShares = 2; 274 Scheme scheme = new Scheme(new SecureRandom(), totalShares, requiredShares); 275 276 // Create shares 277 Map<Integer, byte[]> shares = scheme.split(keyBytes); 278 String colleagueOneShare = Base64.getEncoder().encodeToString(shares.get(1)); 279 String colleagueTwoShare = Base64.getEncoder().encodeToString(shares.get(2)); 280 281 // Distribute share zero to colleague one 282 String time = org.expeditee.stats.Formatter.getDateTime(); 283 String sender = UserSettings.UserName.get(); 284 String topic = "Please help me secure my Expeditee account."; 285 String message = "Run the below action to store a secret key that will help me recover access to my account should I ever loose it."; 286 Map<String, String> options = new HashMap<String, String>(); 287 options.put("Store Secret Key for " + sender, "AuthAddSecretKey " + sender + "PersonalKeyShare " + colleagueOneShare); 288 MailEntry mail = new MailEntry(time, sender, colleagueOne, topic, message, options); 289 Mail.sendMail(mail, colleagueOne); 290 291 // Distribute share one to colleague two 292 options = new HashMap<String, String>(); 293 options.put("Store Secret Key for " + sender, "AuthAddSecretKey " + sender + "PersonalKeyShare " + colleagueTwoShare); 294 mail = new MailEntry(time, sender, colleagueTwo, topic, message, options); 295 Mail.sendMail(mail, colleagueTwo); 296 297 MessageBay.displayMessage("PW Colleagues Set"); 298 } 299 300 public static void emailPasswordShare(String colleagueName) { 301 Path credentialsDirectoryPath = Paths.get(FrameIO.CONTACTS_PATH).resolve(colleagueName + "-credentials"); 302 String colleagueEmail = null; 303 try (Scanner in = new Scanner(credentialsDirectoryPath.resolve("credentials.inf").toFile())) { 304 int parseInt = Integer.parseInt(in.nextLine().replace(".exp", "")); 305 Frame frame = FrameIO.LoadFrame(colleagueName + "-credentials" + parseInt, credentialsDirectoryPath.toAbsolutePath().getParent().toString() + File.separator); 306 Collection<Text> textItems = frame.getTextItems(); 307 textItems.removeIf(text -> !text.getText().startsWith("Email:")); 308 colleagueEmail = textItems.iterator().next().getText().replace("Email:", "").trim(); 309 } catch (FileNotFoundException e) { 310 MessageBay.errorMessage("You do not appear to have contact with: " + colleagueName); 311 return; 312 } 313 314 Frame secretsFrame = FrameIO.LoadFrame(UserSettings.UserName.get() + AuthenticatorBrowser.SECRETS_FRAME); 315 Collection<Text> textItems = secretsFrame.getTextItems(); 316 textItems.removeIf(text -> !text.getText().toLowerCase().equals(colleagueName + "personalkeyshare")); 317 String key = textItems.iterator().next().getData().get(0); 318 319 String nl = System.getProperty("line.separator"); 320 StringBuilder sb = new StringBuilder(); 321 sb.append("In responce to your request for assistance regaining access to your Expeditee account, your colleague " + UserSettings.UserName.get() + " has provided you with the following key share:" + nl); 322 sb.append(key + nl); 323 324 try { 325 sendEmail(colleagueEmail, sb); 326 } catch (MessagingException e) { 327 MessageBay.errorMessage("An error occured sending a email to your colleage " + colleagueName + " with the email " + colleagueEmail); 328 } 329 } 330 331 public static void regainAccountAccess(Map<AuthenticationTag, String> userData) { 332 // Store shares in map 333 Map<Integer, byte[]> contributingParts = new HashMap<Integer, byte[]>(); 334 contributingParts.put(1, Base64.getDecoder().decode(userData.get(AuthenticationTag.PasswordSliceOne))); 335 contributingParts.put(2, Base64.getDecoder().decode(userData.get(AuthenticationTag.PasswordSliceTwo))); 336 337 // initialise shamir 338 int totalShares = 2; 339 int requiredShares = 2; 340 Scheme scheme = new Scheme(new SecureRandom(), totalShares, requiredShares); 341 342 // perform joining 343 byte[] join = scheme.join(contributingParts); 344 345 try { 346 AuthenticatorBrowser.getInstance().putKey(userData.get(AuthenticationTag.Username), userData.get(AuthenticationTag.NewPassword), new SecretKeySpec(join, SymmetricAlgorithm)); 347 } catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | ClassNotFoundException 348 | IOException | SQLException e) { 349 e.printStackTrace(); 350 } 351 352 MessageBay.displayMessage("Your new password has been set."); 97 353 } 98 354 } -
trunk/src/org/expeditee/auth/mail/Mail.java
r1362 r1363 1 package org.expeditee.auth ;1 package org.expeditee.auth.mail; 2 2 3 3 import java.io.File; … … 36 36 import javax.crypto.spec.SecretKeySpec; 37 37 38 import org.expeditee.auth.gui.MailBay; 38 import org.expeditee.auth.AuthenticatorBrowser; 39 import org.expeditee.auth.mail.gui.MailBay; 40 import org.expeditee.encryption.Actions; 39 41 import org.expeditee.gui.FrameIO; 40 42 import org.expeditee.settings.UserSettings; … … 58 60 public static void sendOneOffMail(MailEntry mail, String colleagueName, byte[] key) { 59 61 // Ensure dead drop area is set up. 60 Path databaseFileDirPath = ensureDeadDrops(colleagueName );62 Path databaseFileDirPath = ensureDeadDrops(colleagueName, mail.sender); 61 63 62 64 // Ensure the database file exists. … … 136 138 } 137 139 140 private static Path ensureDeadDrops(String colleagueName, String sender) { 141 String me = sender.toLowerCase(); 142 String them = colleagueName.toLowerCase(); 143 Path parent = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + sender).resolve("deaddrops"); 144 Path databaseFileDirPath = parent.resolve(me + "+" + them); 145 if (!databaseFileDirPath.toFile().exists()) { 146 databaseFileDirPath = parent.resolve(them + "+" + me); 147 } 148 return databaseFileDirPath; 149 } 150 138 151 private static void sendMail(MailEntry mail, PublicKey key, Path databaseFile) { 139 152 try { … … 209 222 statement.close(); 210 223 c.close(); 224 System.err.println("Message written to database: " + databaseFile.toString()); 211 225 } 212 226 … … 235 249 sb.append("Read one-off secure message." + sep); 236 250 sb.append(mail.timestamp + sep); 237 sb.append(mail.sender + sep);251 sb.append(mail.sender.substring(1) + sep); 238 252 sb.append(mail.receiver + sep); 239 253 sb.append(mail.message + sep); … … 368 382 } 369 383 } 384 385 public static void decryptOneOffSecureMessage(SecretKey key, List<String> data) { 386 byte[] topicBytes = Base64.getDecoder().decode(data.get(3)); 387 String topic = new String(org.expeditee.encryption.Actions.DecryptSymmetric(topicBytes, key)); 388 byte[] messageBytes = Base64.getDecoder().decode(data.get(4)); 389 String message = new String(org.expeditee.encryption.Actions.DecryptSymmetric(messageBytes, key)); 390 Map<String, String> options = new HashMap<String, String>(); 391 for (int i = 5; i < data.size(); i+=2) { 392 byte[] optionKeyBytes = Base64.getDecoder().decode(data.get(i)); 393 String k = new String(org.expeditee.encryption.Actions.DecryptSymmetric(optionKeyBytes, key)); 394 byte[] optionValueBytes = Base64.getDecoder().decode(data.get(i + 1)); 395 String v = new String(org.expeditee.encryption.Actions.DecryptSymmetric(optionValueBytes, key)); 396 options.put(k, v); 397 } 398 MailBay.addMessage(data.get(0), topic, message, options); 399 } 370 400 } -
trunk/src/org/expeditee/auth/mail/gui/MailBay.java
r1362 r1363 1 package org.expeditee.auth. gui;1 package org.expeditee.auth.mail.gui; 2 2 3 3 import java.util.LinkedList; -
trunk/src/org/expeditee/auth/tags/AuthenticationTag.java
r1346 r1363 19 19 ColleagueTwo ("txtColleagueTwo", System.getProperty("user.colleague.two")), 20 20 Frameset ("txtFrameset", System.getProperty("user.toshare.frameset")), 21 IntergalacticNumber ("txtIntergalacticNumber", System.getProperty("user.intergalacticnumber")); 21 IntergalacticNumber ("txtIntergalacticNumber", System.getProperty("user.intergalacticnumber")), 22 PasswordSliceOne ("txtPasswordPieceOne", System.getProperty("user.password.piece.one")), 23 PasswordSliceTwo ("txtPasswordPieceTwo", System.getProperty("user.password.piece.two")); 22 24 23 25 public String val; -
trunk/src/org/expeditee/encryption/Actions.java
r1362 r1363 1 package org.expeditee. auth.sharing;1 package org.expeditee.encryption; 2 2 3 3 import java.security.InvalidKeyException; … … 19 19 import javax.crypto.spec.SecretKeySpec; 20 20 21 import org.expeditee.auth.AuthenticatorBrowser; 21 22 import org.expeditee.gui.DisplayController; 22 23 import org.expeditee.gui.Frame; 23 24 import org.expeditee.gui.FrameIO; 24 25 import org.expeditee.items.Text; 26 import org.expeditee.settings.UserSettings; 25 27 import org.ngikm.cryptography.CryptographyConstants; 26 28 … … 190 192 } 191 193 } 194 195 public static void AuthAddSecretKey(String name, String data) { 196 Frame secretsFrame = FrameIO.LoadFrame(UserSettings.UserName.get() + AuthenticatorBrowser.SECRETS_FRAME); 197 secretsFrame.addText(500, 500, name, null).addToData(data); 198 } 192 199 } -
trunk/src/org/expeditee/gui/DisplayController.java
r1314 r1363 28 28 import java.util.function.BooleanSupplier; 29 29 30 import org.expeditee.auth. gui.MailBay;30 import org.expeditee.auth.mail.gui.MailBay; 31 31 import org.expeditee.core.Clip; 32 32 import org.expeditee.core.Colour; -
trunk/src/org/expeditee/gui/FrameIO.java
r1357 r1363 55 55 import org.expeditee.auth.EncryptedExpReader; 56 56 import org.expeditee.auth.EncryptedExpWriter; 57 import org.expeditee.auth. gui.MailBay;57 import org.expeditee.auth.mail.gui.MailBay; 58 58 import org.expeditee.gio.EcosystemManager; 59 59 import org.expeditee.io.Conversion; -
trunk/src/org/expeditee/gui/FrameUtils.java
r1355 r1363 55 55 import org.expeditee.agents.InvalidFramesetNameException; 56 56 import org.expeditee.auth.AuthenticatorBrowser; 57 import org.expeditee.auth. gui.MailBay;57 import org.expeditee.auth.mail.gui.MailBay; 58 58 import org.expeditee.core.Colour; 59 59 import org.expeditee.core.Point; -
trunk/src/org/expeditee/settings/identity/passwordrecovery/Colleagues.java
r1352 r1363 6 6 public static final StringSetting Colleague_One = new StringSetting("Your first password recovery colleague.", null); 7 7 public static final StringSetting Colleague_Two = new StringSetting("Your second password recovery colleague.", null); 8 9 public static final StringSetting Colleague_One_Email = new StringSetting("Your first password recovery colleagues public facing email.", null);10 public static final StringSetting Colleague_Two_Email = new StringSetting("Your second password recovery colleagues public facing email.", null);11 8 }
Note:
See TracChangeset
for help on using the changeset viewer.