mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00

* New LICENSE-COMMERCIAL file * Apply dual licenses: AGPL + Element Commercial to file headers * Update README with dual licensing
44 lines
1.5 KiB
Swift
44 lines
1.5 KiB
Swift
//
|
|
// Copyright 2022-2024 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
import MatrixRustSDK
|
|
|
|
struct KeychainCredentials {
|
|
let userID: String
|
|
let restorationToken: RestorationToken
|
|
}
|
|
|
|
// sourcery: AutoMockable
|
|
protocol KeychainControllerProtocol: ClientSessionDelegate {
|
|
// MARK: Restoration Tokens
|
|
|
|
func setRestorationToken(_ restorationToken: RestorationToken, forUsername: String)
|
|
func restorationTokens() -> [KeychainCredentials]
|
|
func removeRestorationTokenForUsername(_ username: String)
|
|
func removeAllRestorationTokens()
|
|
|
|
// MARK: App Secrets
|
|
|
|
/// Whether or not an App Lock PIN code has been set.
|
|
func containsPINCode() throws -> Bool
|
|
/// Sets a new PIN code for App Lock.
|
|
func setPINCode(_ pinCode: String) throws
|
|
/// The PIN code required to unlock the app.
|
|
func pinCode() -> String?
|
|
/// Removes the App Lock PIN code.
|
|
func removePINCode()
|
|
/// Whether or not PIN code biometric state has been set.
|
|
func containsPINCodeBiometricState() -> Bool
|
|
/// Sets the PIN code biometric state for App Lock.
|
|
func setPINCodeBiometricState(_ state: Data) throws
|
|
/// The PIN code biometric state required to use Touch/Face ID to unlock the app.
|
|
func pinCodeBiometricState() -> Data?
|
|
/// Removes the App Lock PIN code biometric state.
|
|
func removePINCodeBiometricState()
|
|
}
|