SandboxedKeychainStorage
@objc(VSSSandboxedKeychainStorage)
public final class SandboxedKeychainStorage : NSObject
extension SandboxedKeychainStorage: KeychainStorageProtocol
KeychainStorage that sandboxes entries using identity and prefix
-
Underlying key storage
Declaration
Swift
public let keychainStorage: KeychainStorageProtocol
-
User’s identity
Declaration
Swift
@objc public let identity: String?
-
Entries’ name prefix
Declaration
Swift
@objc public let prefix: String?
-
Init
Declaration
Swift
public init(identity: String? = nil, prefix: String? = nil, keychainStorage: KeychainStorageProtocol)
Parameters
identity
User’s identity
prefix
Entries’ name prefix
keychainStorage
KeychainStorage used to store keys
-
Stores key in Keychain
Throws
- Rethrows from
KeychainStorage
errorConvertingKeychainEntry
Declaration
Swift
@objc public func store(data: Data, withName name: String, meta: [String : String]?) throws -> KeychainEntry
Parameters
data
Data
name
Name
meta
Meta
Return Value
Stored Keychain entry
- Rethrows from
-
Updates entry
Declaration
Swift
@objc public func updateEntry(withName name: String, data: Data, meta: [String : String]?) throws
Parameters
name
Name
data
New data
meta
New meta
-
Retrieves entry from Keychain
Throws
- Rethrows from
KeychainStorage
errorConvertingKeychainEntry
Declaration
Swift
@objc public func retrieveEntry(withName name: String) throws -> KeychainEntry
Parameters
name
Name
Return Value
Retrieved Keychain entry
- Rethrows from
-
Retrieves all entries from Keychain
Throws
- Rethrows from
KeychainStorage
errorConvertingKeychainEntry
Declaration
Swift
@objc public func retrieveAllEntries() throws -> [KeychainEntry]
Return Value
All Keychain entries
- Rethrows from
-
Deletes keychain entry
Throws
Rethrows fromKeychainStorage
Declaration
Swift
@objc public func deleteEntry(withName name: String) throws
Parameters
name
Name
-
Checks if entry exists in Keychain
Throws
Rethrows fromKeychainStorage
Declaration
Swift
public func existsEntry(withName name: String) throws -> Bool
Parameters
name
Name
Return Value
true if entry exists, false - otherwise