Files

27 lines
779 B
Swift

//
// KeychainProtocol.swift
//
//
// Created by Nut.Tech on 16.02.2023.
//
import Foundation
public typealias Key = CommonKey
public protocol KeychainProtocol {
/// Checks if a given common key have a password-saved value
/// - Parameter key: Common Key
/// - Returns: is value exists
func exist(_ key: Key) -> Bool
/// Checks if a given common key have a biometric-saved value
/// - Parameter key: Common Key
/// - Returns: is value exists
func bioExist(_ key: Key) -> Bool
/// Access to common key value by biometric authenfication
subscript(biometric key: Key) -> String? { get }
/// Access to common key value by password authenfication
subscript(_ key: Key, password password: String) -> String? { get set }
}