KeychainStorageDelegate
open class KeychainStorageDelegate : StorageDelegate
KeychainStorageDelegate
conforming StorageDelegate
protocol.
-
Access group where
StorageData
is in.Declaration
Swift
open var accessGroup: String?
-
Whether the
StorageData
can be synchronized.Declaration
Swift
open var synchronizable: Bool
-
When
StorageData
can be accessed in the keychain.Declaration
Swift
open var accessible: CFString
-
Create a
KeychainStorageDelegate
.Declaration
Swift
public init()
-
Get
StorageData
forStoreKey
from the keychain.Throws
KeychainError.error
.Declaration
Swift
open func data<D>(forKey key: StoreKey) throws -> D? where D : StorageData
Parameters
key
StoreKey
to store theStorageData
.Return Value
StorageData
forStoreKey
. -
Set
StorageData
forStoreKey
in the keychain.Throws
KeychainError.error
.Declaration
Swift
open func set<D>(_ data: D?, forKey key: StoreKey) throws where D : StorageData
Parameters
data
StorageData
to store.key
StoreKey
to store theStorageData
. -
Remove
StorageData
forStoreKey
from the keychain.Throws
KeychainError.error
.Declaration
Swift
open func remove(forKey key: StoreKey) throws
Parameters
key
StoreKey
to remove. -
Store
StorageData
for account in the keychain.Throws
KeychainError.error
.Declaration
Swift
open func store<D: StorageData>(_ value: D, account: String, accessible: CFString, accessGroup: String?, synchronizable: Bool) throws
Parameters
value
StorageData
to store.account
Item’s account name.
accessible
When the keychain item is accessible.
accessGroup
Access group where
StorageData
is in.synchronizable
Whether the
StorageData
can be synchronized. -
Read
StorageData
for account from the keychain.Throws
KeychainError.error
.Declaration
Swift
open func read<D: StorageData>(account: String, accessGroup: String?, synchronizable: Bool) throws -> D?
Parameters
account
Item’s account name.
accessGroup
Access group where
StorageData
is in.synchronizable
Whether the
StorageData
can be synchronized.Return Value
StorageData
for account. -
Delete item for account from the keychain.
Throws
KeychainError.error
.Declaration
Swift
open func delete(account: String, accessGroup: String?, synchronizable: Bool) throws
Parameters
account
Item’s account name.
accessGroup
Access group where
StorageData
is in.synchronizable
Whether the
StorageData
can be synchronized.