Some cosmetic changes
This commit is contained in:
parent
e447b1d9d3
commit
5f6723246b
7 changed files with 10 additions and 20 deletions
|
|
@ -60,11 +60,7 @@ class GitSSHKeyArmorSettingTableViewController: AutoCellHeightUITableViewControl
|
|||
}
|
||||
|
||||
@IBAction func doneButtonTapped(_ sender: Any) {
|
||||
do {
|
||||
try passwordStore.initGitSSHKey(with: armorPrivateKeyTextView.text)
|
||||
} catch {
|
||||
Utils.alert(title: "CannotSave".localize(), message: "CannotSaveSshKey".localize(), controller: self, completion: nil)
|
||||
}
|
||||
AppKeychain.shared.add(string: armorPrivateKeyTextView.text, for: SshKey.PRIVATE.getKeychainKey())
|
||||
Defaults.gitSSHKeySource = .armor
|
||||
Defaults.gitAuthenticationMethod = .key
|
||||
self.navigationController!.popViewController(animated: true)
|
||||
|
|
|
|||
|
|
@ -13,11 +13,8 @@ import passKit
|
|||
class SSHKeySettingTableViewController: AutoCellHeightUITableViewController {
|
||||
|
||||
@IBOutlet weak var privateKeyURLTextField: UITextField!
|
||||
let passwordStore = PasswordStore.shared
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
}
|
||||
let passwordStore = PasswordStore.shared
|
||||
|
||||
@IBAction func doneButtonTapped(_ sender: UIButton) {
|
||||
guard let privateKeyURL = URL(string: privateKeyURLTextField.text!.trimmed) else {
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
self.keychain.removeContent(for: PgpKey.PRIVATE.getKeychainKey())
|
||||
PGPAgent.shared.uninitKeys()
|
||||
self.pgpKeyTableViewCell.detailTextLabel?.text = "NotSet".localize()
|
||||
Defaults.pgpKeySource = nil
|
||||
}
|
||||
optionMenu.addAction(deleteAction)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@
|
|||
"Import" = "Importieren";
|
||||
"Imported" = "Importiert";
|
||||
"Tips" = "Tipps";
|
||||
"PgpCopyPublicAndPrivateKeyToPass." = "Kopiere den öffentlichen und den privaten Schlüssel im ASCII-Format verschlüsselt mit den Namen \"gpg_key.pub\" bzw. \"gpg_key\" über iTunes zu Pass. Danach können die Schlüssel über \"Datenaustausch über iTunes\" importiert werden.";
|
||||
"FillInGitAccountPassword." = "Bitte gib das Passwort deines Git-Accounts ein.";
|
||||
"NoPasswordStore." = "Es gibt im Moment keinen Passwort Store.";
|
||||
"SyncingPasswordStore" = "Password Store wird synchronisiert";
|
||||
|
|
@ -129,9 +128,10 @@
|
|||
"CannotSavePgpKey" = "PGP-Schlüssel kann nicht gespeichert werden";
|
||||
"SetPgpKeyUrlFirst." = "Bitte gib zuerst die URL des PGP-Schlüssels ein.";
|
||||
"FetchingPgpKey" = "PGP-Schlüssel wird geladen";
|
||||
"RememberToRemoveKey" = "Vergiss das Löschen des Schlüssels nicht";
|
||||
"RememberToRemoveKeyFromServer." = "Vergiss nicht, den Schlüssel wieder vom Server zu entfernen.";
|
||||
"RememberToRemoveKey" = "Vergiss das Löschen der Schlüssel nicht";
|
||||
"RememberToRemoveKeyFromServer." = "Vergiss nicht, die Schlüssel wieder vom Server zu entfernen.";
|
||||
"RemovePgpKeys" = "PGP-Schlüssel entfernen";
|
||||
"PgpCopyPublicAndPrivateKeyToPass." = "Kopiere den öffentlichen und den privaten Schlüssel im ASCII-Format verschlüsselt mit den Namen \"gpg_key.pub\" bzw. \"gpg_key\" über iTunes zu Pass. Danach können die Schlüssel über \"Datenaustausch über iTunes\" importiert werden.";
|
||||
"KeyExpiredOrIncompatibleError." = "Der öffentliche PGP-Schlüssel ist eventuell abgelaufen oder inkompatibel mit dem privaten Schlüssel.";
|
||||
"WrongPassphraseError." = "Das Passwort für den privaten PGP-Schlüssel ist falsch.";
|
||||
|
||||
|
|
@ -285,4 +285,4 @@ geben den öffentlichen und den privaten Schlüssel in diesem speziellen Format
|
|||
$ gpg --export -a KEY_ID
|
||||
$ gpg --export-secret-keys -a KEY_ID
|
||||
|
||||
geben den öffentlichen und den privaten Schlüssel in diesem speziellen Format aus. Kopiere ihn so zu einem Key-Server.";
|
||||
geben den öffentlichen und den privaten Schlüssel in diesem speziellen Format aus. Kopiere sie so zu einem Key-Server.";
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@
|
|||
"CannotSavePgpKey" = "Cannot Save PGP Key";
|
||||
"SetPgpKeyUrlFirst." = "Please set PGP key URL first.";
|
||||
"FetchingPgpKey" = "Fetching PGP Key";
|
||||
"RememberToRemoveKey" = "Remember to Remove the Key";
|
||||
"RememberToRemoveKeyFromServer." = "Remember to remove the key from the server.";
|
||||
"RememberToRemoveKey" = "Remember to Remove the Keys";
|
||||
"RememberToRemoveKeyFromServer." = "Remember to remove the keys from the server.";
|
||||
"RemovePgpKeys" = "Remove PGP Keys";
|
||||
"PgpCopyPublicAndPrivateKeyToPass." = "Copy your ASCII-armored public and private keys to Pass with names \"gpg_key.pub\" and \"gpg_key\" (without quotes) via iTunes. Then come back and click \"iTunes File Sharing\" to finish.";
|
||||
"KeyExpiredOrIncompatibleError." = "PGP public key may be expired or incompatible with the private key.";
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
import Foundation
|
||||
import UIKit
|
||||
|
||||
public class Globals {
|
||||
public final class Globals {
|
||||
public static let bundleIdentifier = "me.mssun.passforios"
|
||||
public static let groupIdentifier = "group." + bundleIdentifier
|
||||
public static let passKitBundleIdentifier = bundleIdentifier + ".passKit"
|
||||
|
|
|
|||
|
|
@ -124,10 +124,6 @@ public class PasswordStore {
|
|||
Defaults.remove(\.gitSSHPrivateKeyArmor)
|
||||
}
|
||||
|
||||
public func initGitSSHKey(with armorKey: String) throws {
|
||||
AppKeychain.shared.add(string: armorKey, for: SshKey.PRIVATE.getKeychainKey())
|
||||
}
|
||||
|
||||
public func repositoryExisted() -> Bool {
|
||||
let fm = FileManager()
|
||||
return fm.fileExists(atPath: Globals.repositoryPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue