@Override protected boolean isUnknownKeyAccepted(final String hostname, final PublicKey key) throws ConnectionCanceledException, ChecksumException { final String message = String.format("%s. %s %s?", LocaleFactory.localizedString("Unknown fingerprint", "Sftp"), MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), new SSHFingerprintGenerator().fingerprint(key), KeyType.fromKey(key).name()), LocaleFactory.localizedString("Continue", "Credentials")); if(!prompt.prompt(message)) { throw new ConnectionCanceledException(); } this.allow(hostname, key, true); return true; }
@Override protected boolean isChangedKeyAccepted(final String hostname, final PublicKey key) throws ConnectionCanceledException, ChecksumException { final String message = String.format("%s. %s %s?", LocaleFactory.localizedString("Changed fingerprint", "Sftp"), MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), new SSHFingerprintGenerator().fingerprint(key), KeyType.fromKey(key).name()), LocaleFactory.localizedString("Continue", "Credentials")); if(!prompt.prompt(message)) { throw new ConnectionCanceledException(); } this.allow(hostname, key, true); return true; } }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(MessageFormat.format(LocaleFactory.localizedString("Changed fingerprint", "Sftp"), hostname)); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), fingerprint, KeyType.fromKey(key).name())); alert.addButtonWithTitle(LocaleFactory.localizedString("Allow")); alert.addButtonWithTitle(LocaleFactory.localizedString("Deny")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(MessageFormat.format(LocaleFactory.localizedString("Unknown fingerprint", "Sftp"), hostname)); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), fingerprint, KeyType.fromKey(key).name())); alert.addButtonWithTitle(LocaleFactory.localizedString("Allow")); alert.addButtonWithTitle(LocaleFactory.localizedString("Deny")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); }