Support ASCII-armored and iTunes uploaded SSH key

This commit is contained in:
Bob Sun 2017-04-02 11:21:24 -07:00
parent 894a6cc54c
commit 97d66a8acc
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
11 changed files with 487 additions and 113 deletions

View file

@ -83,6 +83,16 @@ class Utils {
Utils.removeKeychain(name: ".pgpKeyPassphrase")
}
static func removeGitSSHKeys() {
removeFileIfExists(atPath: Globals.gitSSHPublicKeyPath)
removeFileIfExists(atPath: Globals.gitSSHPrivateKeyPath)
Defaults.remove(.gitSSHPublicKeyArmor)
Defaults.remove(.gitSSHPrivateKeyArmor)
Defaults.remove(.gitSSHPublicKeyURL)
Defaults.remove(.gitSSHPrivateKeyURL)
Utils.removeKeychain(name: ".gitSSHPrivateKeyPassphrase")
}
static func getPasswordFromKeychain(name: String) -> String? {
let keychain = Keychain(service: "me.mssun.passforios")
do {