KeychainStorage
@objc(VSSKeychainStorage)
open class KeychainStorage : NSObject
extension KeychainStorage: KeychainStorageProtocol
Class responsible for Keychain interactions.
-
Comment for all macOS password entries created by this class. Used for filtering
Declaration
Swift
@objc public static let commentStringPrefix: String
-
Comment string
Declaration
Swift
@objc public func commentString() -> String
Return Value
Comment string for macOS Keychain entries
-
Created access for trusted application + current application
Throws
KeychainStorageErrorDeclaration
Swift
@objc public func createAccess(forName name: String, queryOptions: KeychainQueryOptions) throws -> SecAccess
Parameters
name
entry name
Return Value
SecAccess
-
Undocumented
Declaration
Swift
@objc public func createAccessControl() throws -> SecAccessControl
-
Private key identifier format
Declaration
Swift
@objc public static let privateKeyIdentifierFormat: String
-
KeychainStorage parameters
Declaration
Swift
@objc public let storageParams: KeychainStorageParams
-
Initializer
Declaration
Swift
@objc public init(storageParams: KeychainStorageParams)
Parameters
storageParams
KeychainStorage parameters
-
Stores sensitive data to Keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func store(data: Data, withName name: String, meta: [String: String]?, queryOptions: KeychainQueryOptions?) throws -> KeychainEntry
Parameters
data
Sensitive data
name
Alias for data
meta
Additional meta info
Return Value
Stored entry
-
Updated entry in Keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func updateEntry(withName name: String, data: Data, meta: [String: String]?, queryOptions: KeychainQueryOptions?) throws
Parameters
name
Alias
data
New data
meta
New meta info
-
Retrieves entry from keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func retrieveEntry(withName name: String, queryOptions: KeychainQueryOptions?) throws -> KeychainEntry
Parameters
name
Alias
Return Value
Retrieved entry
-
Retrieves all entries in Keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func retrieveAllEntries(queryOptions: KeychainQueryOptions?) throws -> [KeychainEntry]
Return Value
Retrieved entries
-
Deletes entry from Keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func deleteEntry(withName name: String, queryOptions: KeychainQueryOptions?) throws
Parameters
name
Alias
-
Deletes all entries from Keychain
Throws
KeychainStorageErrorDeclaration
Swift
@objc open func deleteAllEntries(queryOptions: KeychainQueryOptions? = nil) throws
-
Checks if entry exists in Keychain
Throws
KeychainStorageErrorDeclaration
Swift
public func existsEntry(withName name: String, queryOptions: KeychainQueryOptions?) throws -> Bool
Parameters
name
Alias
Return Value
true if entry exists, false otherwise
-
Declaration
Swift
public func retrieveAllEntries() throws -> [KeychainEntry]
-
Declaration
Swift
public func deleteEntry(withName name: String) throws
-
Declaration
Swift
public func existsEntry(withName name: String) throws -> Bool
-
Declaration
Swift
public func retrieveEntry(withName name: String) throws -> KeychainEntry
-
Declaration
Swift
public func updateEntry(withName name: String, data: Data, meta: [String : String]?) throws
-
Declaration
Swift
public func store(data: Data, withName name: String, meta: [String : String]?) throws -> KeychainEntry