CloudKeyStorage

@objc(VSSCloudKeyStorage)
open class CloudKeyStorage : NSObject
extension CloudKeyStorage: CloudKeyStorageProtocol

Class responsible for storing Keys in Cloud using E2EE

  • KeyknoxManager

    Declaration

    Swift

    @objc
    public let keyknoxManager: KeyknoxManager
  • Public keys used for encryption and signature verification

    Declaration

    Swift

    @objc
    public internal(set) var publicKeys: [VirgilPublicKey] { get }
  • Private key used for decryption and signing

    Declaration

    Swift

    @objc
    public internal(set) var privateKey: VirgilPrivateKey { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public static let root: String
  • Undocumented

    Declaration

    Swift

    @objc
    public static let path: String
  • key

    Undocumented

    Declaration

    Swift

    @objc
    public static let key: String
  • Shows whether this storage was synced

    Declaration

    Swift

    @objc
    public var storageWasSynced: Bool { get }
  • Init

    Declaration

    Swift

    @objc
    public init(keyknoxManager: KeyknoxManager, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey)

    Parameters

    keyknoxManager

    KeyknoxManager

  • Init

    Throws

    Rethrows from KeyknoxManager

    Declaration

    Swift

    @objc
    public convenience init(accessTokenProvider: AccessTokenProvider,
                            crypto: VirgilCrypto,
                            publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey) throws

    Parameters

    accessTokenProvider

    AccessTokenProvider implementation

    crypto

    Crypto

    publicKeys

    Public keys used for encryption and signature verification

    privateKey

    Private key used for decryption and signature verification

Obj-C extension

  • Retrieves entries from Cloud

    Declaration

    Swift

    @objc
    open func retrieveCloudEntries(completion: @escaping (Error?) -> Void)

    Parameters

    completion

    Completion handler

  • Stores entries to cloud

    Declaration

    Swift

    @objc
    open func storeEntries(_ keyEntries: [KeyknoxKeyEntry], completion: @escaping (Error?) -> Void)

    Parameters

    keyEntries

    Entries to store

    completion

    Completion handler

  • Checks if entry exists in list of loaded from Cloud entries

    Declaration

    Swift

    @objc
    open func existsEntryNoThrow(withName name: String) -> Bool

    Parameters

    name

    Entry name

    Return Value

    true if entry exists, false - otherwise

  • Stores entry to cloud

    Declaration

    Swift

    @objc
    open func storeEntry(withName name: String, data: Data, meta: [String: String]? = nil,
                         completion: @escaping (Error?) -> Void)

    Parameters

    name

    Name

    data

    Data

    meta

    Meta

    completion

    Completion handler

  • Deletes entry from Cloud

    Declaration

    Swift

    @objc
    open func deleteEntry(withName name: String, completion: @escaping (Error?) -> Void)

    Parameters

    name

    Entry name

    completion

    Completion handler

  • Deletes entries from Cloud

    Declaration

    Swift

    @objc
    open func deleteEntries(withNames names: [String], completion: @escaping (Error?) -> Void)

    Parameters

    names

    Names of entries to delete

    completion

    Completion handler

  • Deletes all entries from Cloud

    Declaration

    Swift

    @objc
    open func deleteAllEntries(completion: @escaping (Error?) -> Void)

    Parameters

    completion

    Completion handler

  • Updates entry in Cloud

    Declaration

    Swift

    @objc
    open func updateEntry(withName name: String, data: Data,
                          meta: [String: String]? = nil,
                          completion: @escaping (CloudEntry?, Error?) -> Void)

    Parameters

    name

    Name

    data

    New data

    meta

    New meta

    completion

    Completion handler

  • Updated recipients. See KeyknoxManager.updateRecipients

    Declaration

    Swift

    @objc
    open func updateRecipients(newPublicKeys: [VirgilPublicKey]? = nil,
                               newPrivateKey: VirgilPrivateKey? = nil,
                               completion: @escaping (Error?) -> Void)

    Parameters

    newPublicKeys

    New public keys

    newPrivateKey

    New private key

    completion

    Completion handler

  • Stores entries to cloud

    Declaration

    Swift

    public func storeEntries(_ keyEntries: [KeyknoxKeyEntry]) -> GenericOperation<[CloudEntry]>

    Parameters

    keyEntries

    Entries to store

    Return Value

    GenericOperation<[CloudEntry]>

  • Stores entry to cloud

    Declaration

    Swift

    public func storeEntry(withName name: String, data: Data,
                         meta: [String: String]? = nil) -> GenericOperation<CloudEntry>

    Parameters

    name

    Name

    data

    Data

    meta

    Meta

    Return Value

    GenericOperation

  • Updates entry in Cloud

    Declaration

    Swift

    public func updateEntry(withName name: String, data: Data,
                          meta: [String: String]? = nil) -> GenericOperation<CloudEntry>

    Parameters

    name

    Name

    data

    New data

    meta

    New meta

    Return Value

    GenericOperation

  • Retrieves entry loaded from Cloud

    Throws

    CloudKeyStorageError.cloudStorageOutOfSync

    Declaration

    Swift

    @objc
    open func retrieveEntry(withName name: String) throws -> CloudEntry

    Parameters

    name

    Name

    Return Value

    Entry

  • Returns all entries loaded from Cloud

    Throws

    CloudKeyStorageError.cloudStorageOutOfSync if storage was not synced

    Declaration

    Swift

    @objc
    open func retrieveAllEntries() throws -> [CloudEntry]

    Return Value

    All entries

  • Checks if entry exists in list of loaded from Cloud entries

    Throws

    CloudKeyStorageError.cloudStorageOutOfSync if storage was not synced

    Declaration

    Swift

    public func existsEntry(withName name: String) throws -> Bool

    Parameters

    name

    Entry name

    Return Value

    true if entry exists, false - otherwise

  • Deletes entry from Cloud

    Declaration

    Swift

    public func deleteEntry(withName name: String) -> GenericOperation<Void>

    Parameters

    name

    Entry name

    Return Value

    GenericOperation

  • Deletes entries from Cloud

    Declaration

    Swift

    public func deleteEntries(withNames names: [String]) -> GenericOperation<Void>

    Parameters

    names

    Names of entries to delete

    Return Value

    GenericOperation

  • Deletes all entries from Cloud

    Declaration

    Swift

    public func deleteAllEntries() -> GenericOperation<Void>

    Return Value

    GenericOperation

  • Updates recipients. See KeyknoxManager.updateRecipients

    Declaration

    Swift

    public func updateRecipients(newPublicKeys: [VirgilPublicKey]? = nil,
                               newPrivateKey: VirgilPrivateKey? = nil) -> GenericOperation<Void>

    Parameters

    newPublicKeys

    New public keys

    newPrivateKey

    New private key

    Return Value

    GenericOperation

  • Retrieves entries from Cloud

    Declaration

    Swift

    public func retrieveCloudEntries() -> GenericOperation<Void>

    Return Value

    GenericOperation