mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 16:21:00 +00:00
41 lines
1.1 KiB
Swift
41 lines
1.1 KiB
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
struct MockKeychainService {}
|
|
|
|
extension MockKeychainService {
|
|
static func reset() {
|
|
items = [String: Data]()
|
|
}
|
|
}
|
|
|
|
extension MockKeychainService: KeychainService {
|
|
static func setGenericPassword(data: Data, forAccount key: String, service: String) throws {
|
|
items[key] = data
|
|
}
|
|
|
|
static func deleteGenericPassword(account: String, service: String) throws {
|
|
items[account] = nil
|
|
}
|
|
|
|
static func getGenericPassword(account: String, service: String) throws -> Data? {
|
|
items[account]
|
|
}
|
|
|
|
static func generateKeyAndReturnPublicKey(applicationTag: String, attributes: [String: Any]) throws -> Data {
|
|
fatalError("not implemented")
|
|
}
|
|
|
|
static func getPrivateKey(applicationTag: String, attributes: [String: Any]) throws -> Data? {
|
|
fatalError("not implemented")
|
|
}
|
|
|
|
static func deleteKey(applicationTag: String) throws {
|
|
fatalError("not implemented")
|
|
}
|
|
}
|
|
|
|
private extension MockKeychainService {
|
|
static var items = [String: Data]()
|
|
}
|