Secure backup: Allow to execute a random closure the secure backup is unlocked

Only from swift.
We should change the name "SecretsRecovery" classes
This commit is contained in:
manuroe
2021-06-16 07:44:12 +02:00
parent 961d323407
commit df628da793
8 changed files with 83 additions and 27 deletions
@@ -16,10 +16,28 @@
import Foundation
enum SecretsRecoveryGoal {
case `default`
case keyBackup
/// Unlock the secure backup (4S) to get the private key and execute a closure during the flow
case unlockSecureBackup ((_ privateKey: Data, _ completion: @escaping (Result<Void, Error>) -> Void) -> Void)
case verifyDevice
case restoreSecureBackup
}
@objc
enum SecretsRecoveryGoal: Int {
enum SecretsRecoveryGoalBridge: Int {
case `default`
case keyBackup
case verifyDevice
case restoreSecureBackup
var goal: SecretsRecoveryGoal {
switch self {
case .default: return .default
case .keyBackup: return .keyBackup
case .verifyDevice: return .verifyDevice
case .restoreSecureBackup: return .restoreSecureBackup
}
}
}