From 3c8897bf131aaf9585092177452d6105069856bc Mon Sep 17 00:00:00 2001 From: Frank Gregor Date: Fri, 5 Jun 2020 11:30:40 +0200 Subject: [PATCH] SecurityHelper additions --- ios/OX Coi/Extensions/UIKit/AppDelegate+Security.swift | 10 ++++++++-- ios/OX Coi/Helper/SecurityHelper.swift | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ios/OX Coi/Extensions/UIKit/AppDelegate+Security.swift b/ios/OX Coi/Extensions/UIKit/AppDelegate+Security.swift index 01303750..80aa43dc 100644 --- a/ios/OX Coi/Extensions/UIKit/AppDelegate+Security.swift +++ b/ios/OX Coi/Extensions/UIKit/AppDelegate+Security.swift @@ -54,8 +54,14 @@ extension AppDelegate { switch call.method { case MethodChannel.Security.Method.Decrypt: if let messageDict = call.arguments as? [String: String] { - let securityHelper = SecurityHelper(message: messageDict) - result(securityHelper.decryptedMessage) +// do { +// let securityHelper = try SecurityHelper(message: messageDict) +// let decryptedMessage = try securityHelper.getDecryptedMessage() +// result(decryptedMessage) +// +// } catch { +// throw SecurityHelperError.decryptMessageFailed(error: error.localizedDescription) +// } return } diff --git a/ios/OX Coi/Helper/SecurityHelper.swift b/ios/OX Coi/Helper/SecurityHelper.swift index 7fcec17a..2febf623 100644 --- a/ios/OX Coi/Helper/SecurityHelper.swift +++ b/ios/OX Coi/Helper/SecurityHelper.swift @@ -147,5 +147,6 @@ enum SecurityHelperError: Error { case authSecretGenerationFailed(error: String) case privateKeyGenerationFailed(error: String) case publicKeyGenerationFailed(error: String) + case decryptMessageFailed(error: String) }