support ASCII armor encrypted PGP keys

This commit is contained in:
Bob Sun 2017-02-17 13:44:25 +08:00
parent b5313b1dfc
commit a5f13a1e8a
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 377 additions and 66 deletions

View file

@ -58,6 +58,18 @@ class Utils {
controller.present(alert, animated: true, completion: completion)
}
static func removePGPKeys() {
removeFileIfExists(atPath: Globals.pgpPublicKeyPath)
removeFileIfExists(atPath: Globals.pgpPrivateKeyPath)
Defaults.remove(.pgpKeySource)
Defaults.remove(.pgpKeyPassphrase)
Defaults.remove(.pgpPublicKeyArmor)
Defaults.remove(.pgpPrivateKeyArmor)
Defaults.remove(.pgpPrivateKeyURL)
Defaults.remove(.pgpPublicKeyURL)
Defaults.remove(.pgpKeyID)
}
}
// https://gist.github.com/NikolaiRuhe/eeb135d20c84a7097516