KeychainStorageDelegate
open class KeychainStorageDelegate : StorageDelegate
KeychainStorageDelegate conforming StorageDelegate protocol.
-
Access group where
StorageDatais in.Declaration
Swift
open var accessGroup: String? -
Whether the
StorageDatacan be synchronized.Declaration
Swift
open var synchronizable: Bool -
When
StorageDatacan be accessed in the keychain.Declaration
Swift
open var accessible: CFString -
Specifies item class used.
Declaration
Swift
open var secClass: CFString -
Create a
KeychainStorageDelegate.Declaration
Swift
public init() -
Get
StorageDataforStoreKeyfrom the keychain.Throws
KeychainError.error.Declaration
Swift
@StorageActor open func data<D>(forKey key: StoreKey) throws -> D? where D : StorageDataParameters
keyStoreKeyto store theStorageData.Return Value
StorageDataforStoreKey. -
Set
StorageDataforStoreKeyin the keychain.Throws
KeychainError.error.Declaration
Swift
@StorageActor open func set(_ data: (some StorageData)?, forKey key: StoreKey) throwsParameters
dataStorageDatato store.keyStoreKeyto store theStorageData. -
Remove
StorageDataforStoreKeyfrom the keychain.Throws
KeychainError.error.Declaration
Swift
@StorageActor open func remove(forKey key: StoreKey) throwsParameters
keyStoreKeyto remove. -
Store
StorageDatafor account in the keychain.Throws
KeychainError.error.Declaration
Swift
open func store(_ value: some StorageData, key: String, accessible: CFString = kSecAttrAccessibleWhenUnlocked, accessGroup: String? = nil, synchronizable: Bool = false, secClass: CFString = kSecClassGenericPassword) throwsParameters
valueStorageDatato store.accountItem’s account name.
accessibleWhen the keychain item is accessible.
accessGroupAccess group where
StorageDatais in.synchronizableWhether the
StorageDatacan be synchronized.secClassSpecifies item class used.
-
Read
StorageDatafor account from the keychain.Throws
KeychainError.error.Declaration
Swift
open func read<D: StorageData>(key: String, accessGroup: String? = nil, synchronizable: Bool = false, secClass: CFString = kSecClassGenericPassword, returnAttributes: Bool? = nil, returnData: Bool = true) throws -> D?Parameters
accountItem’s account name.
accessGroupAccess group where
StorageDatais in.synchronizableWhether the
StorageDatacan be synchronized.secClassSpecifies item class used.
returnAttributesReturn item attributes.
returnDataReturn item data.
Return Value
StorageDatafor account. -
Delete item for account from the keychain.
Throws
KeychainError.error.Declaration
Swift
open func delete(key: String, accessGroup: String? = nil, synchronizable: Bool = false, secClass: CFString = kSecClassGenericPassword) throwsParameters
accountItem’s account name.
accessGroupAccess group where
StorageDatais in.synchronizableWhether the
StorageDatacan be synchronized.secClassSpecifies item class used.
View on GitHub
Install in Dash