KeyknoxManager
@objc(VSSKeyknoxManager)
open class KeyknoxManager : NSObject
Class responsible for managing Keyknox value with E2EE
-
KeyknoxClient instance used for performing queries
Declaration
Swift
@objc public let keyknoxClient: KeyknoxClientProtocol
-
KeyknoxCryptoProtocol implementation
Declaration
Swift
public let crypto: KeyknoxCryptoProtocol
-
Init
Throws
KeyknoxManagerError.noPublicKeys if public keys array is emptyDeclaration
Swift
public init(keyknoxClient: KeyknoxClientProtocol, crypto: KeyknoxCryptoProtocol? = nil) throws
Parameters
keyknoxClient
KeyknoxClientProtocol implementation
crypto
KeyknoxCryptoProtocol implementation
-
Init
Throws
KeyknoxManagerError.noPublicKeysDeclaration
Swift
@objc public convenience init(accessTokenProvider: AccessTokenProvider, crypto: VirgilCrypto) throws
Parameters
accessTokenProvider
AccessTokenProvider implementation
crypto
Crypto
-
Pushes value
Declaration
Swift
@objc open func pushValue(params: KeyknoxPushParams? = nil, data: Data, previousHash: Data?, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey, completion: @escaping (DecryptedKeyknoxValue?, Error?) -> Void)
Parameters
params
Push params
data
data to push
previousHash
Previous hash
publicKeys
public keys to encrypt
privateKey
private key to sign
completion
completion handler
-
Pulls value
Declaration
Swift
@objc open func pullValue(params: KeyknoxPullParams? = nil, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey, completion: @escaping (DecryptedKeyknoxValue?, Error?) -> Void)
Parameters
params
Pull params
publicKeys
public keys to verify signature
privateKey
private key to decrypt
completion
completion handler
-
Returns set of keys
Declaration
Swift
@objc open func getKeys(params: KeyknoxGetKeysParams, completion: @escaping (Set<String>?, Error?) -> Void)
Parameters
params
Get keys params
- completion: completion handler
-
Resets Keyknox value (makes it empty)
- params: Reset pararms
- completion: completion handler
Declaration
Swift
@objc open func resetValue(params: KeyknoxResetParams? = nil, completion: @escaping(DecryptedKeyknoxValue?, Error?) -> Void)
-
Deletes recipient from list of shared
Declaration
Swift
@objc open func deleteRecipient(params: KeyknoxDeleteRecipientParams, completion: @escaping (DecryptedKeyknoxValue?, Error?) -> Void)
Parameters
params
Delete recipient params
completion
completion handler
-
Pushes value
Declaration
Swift
public func pushValue(params: KeyknoxPushParams? = nil, data: Data, previousHash: Data?, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey) -> GenericOperation<DecryptedKeyknoxValue>
Parameters
params
Push params
data
data to push
previousHash
Previous hash
publicKeys
public keys to encrypt
privateKey
private key to sign
Return Value
GenericOperation
-
Pulls value
Declaration
Swift
public func pullValue(params: KeyknoxPullParams? = nil, publicKeys: [VirgilPublicKey], privateKey: VirgilPrivateKey) -> GenericOperation<DecryptedKeyknoxValue>
Parameters
params
Pull params
publicKeys
public keys to verify signature
privateKey
private key to decrypt
Return Value
GenericOperation
-
Returns set of keys
Declaration
Swift
public func getKeys(params: KeyknoxGetKeysParams) -> GenericOperation<Set<String>>
Parameters
params
Get keys params
Return Value
GenericOperation
> -
Resets Keyknox value (makes it empty)
Declaration
Swift
public func resetValue(params: KeyknoxResetParams? = nil) -> GenericOperation<DecryptedKeyknoxValue>
Parameters
params
reset params
Return Value
GenericOperation
-
Deletes recipient from list of shared
Declaration
Swift
public func deleteRecipient(params: KeyknoxDeleteRecipientParams) -> GenericOperation<DecryptedKeyknoxValue>
Parameters
params
Delete recipient params
Return Value
GenericOperation