Refactor logic of request PGP key passphrase

This commit is contained in:
Mingshen Sun 2020-04-13 15:16:03 -07:00
parent e62f4714e8
commit e9c5b63c4b
10 changed files with 44 additions and 104 deletions

View file

@ -698,7 +698,7 @@ public class PasswordStore {
return try storeRepository.localCommitsRelative(toRemoteBranch: remoteBranch)
}
public func decrypt(passwordEntity: PasswordEntity, requestPGPKeyPassphrase: () -> String) throws -> Password? {
public func decrypt(passwordEntity: PasswordEntity, requestPGPKeyPassphrase: (String) -> String) throws -> Password? {
let encryptedDataPath = storeURL.appendingPathComponent(passwordEntity.getPath())
let keyID = findGPGID(from: encryptedDataPath)
let encryptedData = try Data(contentsOf: encryptedDataPath)