SyncKeyStorage
@objc(VSSSyncKeyStorage)
open class SyncKeyStorage : NSObject
Class responsible for synchronization between Keychain and Keyknox Cloud
-
CloudKeyStorageProtocol implementation
Declaration
Swift
public let cloudKeyStorage: CloudKeyStorageProtocol -
Creates local key storage instance, to read keys withoud connecting to the Cloud
Declaration
Swift
public static func makeLocalStorage(identity: String, keychainStorage: KeychainStorageProtocol) -> KeychainStorageProtocolParameters
identityUser’s identity to separate keys in Keychain
keychainStorageKeychainStorageProtocol implementation
Return Value
returns KeychainStorageProtocol
-
Init
Declaration
Swift
public init(identity: String, keychainStorage: KeychainStorageProtocol, cloudKeyStorage: CloudKeyStorageProtocol)Parameters
identityUser’s identity to separate keys in Keychain
keychainStorageKeychainStorageProtocol implementation
cloudKeyStorageCloudKeyStorageProtocol implementation
-
Init
Throws
Rethrows fromKeychainStorageParamsDeclaration
Swift
@objc public convenience init(identity: String, cloudKeyStorage: CloudKeyStorage) throwsParameters
identityUser’s identity to separate keys in Keychain
cloudKeyStorageCloudKeyStorageProtocol implementation
-
Init
Declaration
Swift
@objc public convenience init(identity: String, accessTokenProvider: AccessTokenProvider, crypto: VirgilCrypto, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey) throwsParameters
identityUser’s identity to separate keys in Keychain
cryptoCrypto
accessTokenProviderAccessTokenProvider implementation
publicKeysPublic keys used for encryption and signature verification
privateKeyPrivate key used for decryption and signature generation
-
Updates entry in Keyknox Cloud and Keychain
Declaration
Swift
@objc open func updateEntry(withName name: String, data: Data, meta: [String: String]?, completion: @escaping (Error?) -> Void)Parameters
nameName
dataNew data
metaNew meta
completionCompletion handler
-
Deletes entries from both Keychain and Keyknox Cloud
Declaration
Swift
@objc open func deleteEntry(withName name: String, completion: @escaping (Error?) -> Void)Parameters
nameNames to delete
completionCompletion handler
-
Stores entry in both Keychain and Keyknox Cloud
Declaration
Swift
@objc open func storeEntry(withName name: String, data: Data, meta: [String: String]? = nil, completion: @escaping (KeychainEntry?, Error?) -> Void)Parameters
nameName
dataData
metaMeta
completionCompletion handler
-
Performs synchronization between Keychain and Keyknox Cloud
Declaration
Swift
@objc open func sync(completion: @escaping (Error?) -> Void)Parameters
completionCompletion handler
-
Checks if entry exists in Keychain
Declaration
Swift
@objc open func existsEntryNoThrow(withName name: String) -> BoolParameters
nameEntry name
Return Value
true if entry exists, false - otherwise
-
Stores entries in both Keychain and Keyknox Cloud
Declaration
Swift
@objc open func storeEntries(_ keyEntries: [KeyknoxKeyEntry], completion: @escaping ([KeychainEntry]?, Error?) -> Void)Parameters
keyEntriesKey entries to store
completionCompletion handler
-
Deletes entries from both Keychain and Keyknox Cloud
Declaration
Swift
@objc open func deleteEntries(withNames names: [String], completion: @escaping (Error?) -> Void)Parameters
namesNames to delete
completionCompletion handler
-
Updates recipients. See KeyknoxManager.updateRecipients
Declaration
Swift
@objc open func updateRecipients(newPublicKeys: [VirgilPublicKey]? = nil, newPrivateKey: VirgilPrivateKey? = nil, completion: @escaping (Error?) -> Void)Parameters
newPublicKeysNew public keys
newPrivateKeyNew private key
completionCompletion handler
-
Deletes all entries in both Keychain and Keyknox Cloud
Declaration
Swift
@objc open func deleteAllEntries(completion: @escaping (Error?) -> Void)Parameters
completionCompletion handler
-
Updates entry in Keyknox Cloud and Keychain
Declaration
Swift
public func updateEntry(withName name: String, data: Data, meta: [String : String]?) -> GenericOperation<Void>Parameters
nameName
dataNew data
metaNew meta
Return Value
GenericOperation
-
Retrieves entry from Keychain
Throws
Rethrows fromKeychainStorageDeclaration
Swift
@objc open func retrieveEntry(withName name: String) throws -> KeychainEntryParameters
nameName
Return Value
KeychainEntry
-
Deletes entries from both Keychain and Keyknox Cloud
Declaration
Swift
public func deleteEntries(withNames names: [String]) -> GenericOperation<Void>Parameters
namesNames to delete
Return Value
GenericOperation
-
Deletes entry from both Keychain and Keyknox Cloud
Declaration
Swift
public func deleteEntry(withName name: String) -> GenericOperation<Void>Parameters
nameName
Return Value
GenericOperation
-
Stores entry in both Keychain and Keyknox Cloud
Declaration
Swift
public func storeEntry(withName name: String, data: Data, meta: [String: String]? = nil) -> GenericOperation<KeychainEntry>Parameters
nameName
dataData
metaMeta
Return Value
GenericOperation
-
Stores entries in both Keychain and Keyknox Cloud
Declaration
Swift
public func storeEntries(_ keyEntries: [KeyknoxKeyEntry]) -> GenericOperation<[KeychainEntry]>Parameters
keyEntriesKey entries to store
Return Value
GenericOperation<[KeychainEntry]>
-
Performs synchronization between Keychain and Keyknox Cloud
Declaration
Swift
public func sync() -> GenericOperation<Void>Return Value
GenericOperation
-
Updates recipients. See KeyknoxManager.updateRecipients
Declaration
Swift
public func updateRecipients(newPublicKeys: [VirgilPublicKey]? = nil, newPrivateKey: VirgilPrivateKey? = nil) -> GenericOperation<Void>Parameters
newPublicKeysNew public keys
newPrivateKeyNew private key
Return Value
GenericOperation
-
Retrieves all entries from Keychain
Throws
Rethrows fromKeychainStorageDeclaration
Swift
public func retrieveAllEntries() throws -> [KeychainEntry]Return Value
Keychain entries
-
Checks if entry exists in Keychain
Throws
Rethrows fromKeychainStorageDeclaration
Swift
public func existsEntry(withName name: String) throws -> BoolParameters
nameEntry name
Return Value
true if entry exists, false otherwise
-
Deletes all entries in both Keychain and Keyknox Cloud
Declaration
Swift
public func deleteAllEntries() -> GenericOperation<Void>Return Value
GenericOperation
SyncKeyStorage Class Reference