An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alpha-wallet-ios/Trust/Core/Initializers/TouchRegistrar.swift

41 lines
994 B

// Copyright SIX DAY LLC. All rights reserved.
import Foundation
import VENTouchLock
import SSKeychain
class TouchRegistrar {
struct Keys {
static let service = "trust.lock"
static let account = "trust.account"
}
private let keystore: Keystore
init(
keystore: Keystore
) {
self.keystore = keystore
}
func register() {
if !keystore.hasWallets {
unregister()
}
VENTouchLock.sharedInstance().setKeychainService(
Keys.service,
keychainAccount: Keys.account,
touchIDReason: "Use your fingerprint to access your wallet",
passcodeAttemptLimit: 5,
splashViewControllerClass: ProtectionViewController.self
)
}
func unregister() {
SSKeychain.deletePassword(forService: Keys.service, account: Keys.account)
VENTouchLock.sharedInstance().deletePasscode()
VENTouchLock.setShouldUseTouchID(false)
}
}