remove overload, caller can take care of it in 2 step process
This commit is contained in:
parent
e32402b807
commit
566b7253f5
2 changed files with 4 additions and 8 deletions
|
|
@ -30,8 +30,11 @@ func decryptPassword(
|
|||
}
|
||||
DispatchQueue.global(qos: .userInteractive).async {
|
||||
do {
|
||||
guard let passwordEntity = PasswordStore.shared.fetchPasswordEntity(with: passwordPath) else {
|
||||
throw AppError.decryption
|
||||
}
|
||||
let requestPGPKeyPassphrase = Utils.createRequestPGPKeyPassphraseHandler(controller: controller)
|
||||
let decryptedPassword = try PasswordStore.shared.decrypt(path: passwordPath, keyID: keyID, requestPGPKeyPassphrase: requestPGPKeyPassphrase)
|
||||
let decryptedPassword = try PasswordStore.shared.decrypt(passwordEntity: passwordEntity, keyID: keyID, requestPGPKeyPassphrase: requestPGPKeyPassphrase)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
completion(decryptedPassword)
|
||||
|
|
|
|||
|
|
@ -403,13 +403,6 @@ public class PasswordStore {
|
|||
return Password(name: passwordEntity.name, path: passwordEntity.path, plainText: plainText)
|
||||
}
|
||||
|
||||
public func decrypt(path: String, keyID: String? = nil, requestPGPKeyPassphrase: @escaping (String) -> String) throws -> Password {
|
||||
guard let passwordEntity = fetchPasswordEntity(with: path) else {
|
||||
throw AppError.decryption
|
||||
}
|
||||
return try decrypt(passwordEntity: passwordEntity, keyID: keyID, requestPGPKeyPassphrase: requestPGPKeyPassphrase)
|
||||
}
|
||||
|
||||
public func encrypt(password: Password, keyID: String? = nil) throws -> Data {
|
||||
let keyIDs: [String] = {
|
||||
if let keyID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue