Cleanup and fix the erase logic

Explicitly uninit PGP agent during erasing all data.
This commit is contained in:
Yishi Lin 2019-10-01 00:40:33 +08:00
parent 230b421a90
commit e0c32003e3
2 changed files with 15 additions and 8 deletions

View file

@ -21,6 +21,7 @@ public class PGPAgent {
public func initKeys() throws {
guard let publicKey: String = keyStore.get(for: PgpKey.PUBLIC.getKeychainKey()),
let privateKey: String = keyStore.get(for: PgpKey.PRIVATE.getKeychainKey()) else {
pgpInterface = nil
throw AppError.KeyImport
}
do {