Fix cannot removing PGP keys

This commit is contained in:
Bob Sun 2017-06-03 18:12:33 -07:00
parent e549db0714
commit b2d93c8a70
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
4 changed files with 29 additions and 25 deletions

View file

@ -70,28 +70,6 @@ class Utils {
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: handler))
controller.present(alert, animated: true, completion: completion)
}
static func removePGPKeys() {
removeFileIfExists(atPath: Globals.pgpPublicKeyPath)
removeFileIfExists(atPath: Globals.pgpPrivateKeyPath)
Defaults.remove(.pgpKeySource)
Defaults.remove(.pgpPublicKeyArmor)
Defaults.remove(.pgpPrivateKeyArmor)
Defaults.remove(.pgpPrivateKeyURL)
Defaults.remove(.pgpPublicKeyURL)
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")