RatchetClient
@objc(VSRRatchetClient)
open class RatchetClient : BaseClient
extension RatchetClient: RatchetClientProtocol
Implemetation of RatchetClientProtocol
- Tag: RatchetClient
-
Default URL for service
Declaration
Swift
@objc public static let defaultURL: URL -
Initializes a new
RatchetClientinstanceDeclaration
Swift
public init(accessTokenProvider: AccessTokenProvider, serviceUrl: URL = RatchetClient.defaultURL, connection: HttpConnectionProtocol? = nil, retryConfig: ExpBackoffRetry.Config)Parameters
accessTokenProviderAccess token provider
serviceUrlURL of service client will use
connectioncustom HTTPConnection
-
Initializes new
RatchetClientinstanceDeclaration
Swift
@objc public convenience init(accessTokenProvider: AccessTokenProvider)Parameters
accessTokenProviderAccess Token Provider
-
Initializes new
RatchetClientinstanceDeclaration
Swift
@objc public convenience init(accessTokenProvider: AccessTokenProvider, serviceUrl: URL)Parameters
accessTokenProviderAccess Token Provider
serviceUrlservice URL
-
Uploads public keys
Long-term public key signature should be verified. Upload priority: identity card id > long-term public key > one-time public key. Which means long-term public key can’t be uploaded if identity card id is absent in the cloud and one-time public key can’t be uploaded if long-term public key is absent in the cloud.
Throws
RatchetClientError.constructingUrl- Rethrows from
ServiceRequest - Rethrows from
HttpConnectionProtocol - Rethrows from
JSONDecoder - Rethrows from
BaseClient
Declaration
Swift
public func uploadPublicKeys(identityCardId: String?, longTermPublicKey: SignedPublicKey?, oneTimePublicKeys: [Data]) throwsParameters
identityCardIdIdentity cardId that should be available on Card service.
longTermPublicKeylong-term public key + its signature created using identity private key. Should be curve25519 in PKCS#8
oneTimePublicKeysone-time public keys (up to 150 keys in the cloud). Should be curve25519 in PKCS#8
-
Checks list of keys ids and returns subset of that list with already used keys ids
Note
keyId == SHA512(raw 32-byte publicKey)[0..<8]
Throws
Throws:
RatchetClientError.constructingUrl- Rethrows from
ServiceRequest - Rethrows from
HttpConnectionProtocol - Rethrows from
JSONDecoder - Rethrows from
BaseClient
Declaration
Swift
public func validatePublicKeys(longTermKeyId: Data?, oneTimeKeysIds: [Data]) throws -> ValidatePublicKeysResponseParameters
longTermKeyIdlong-term public key id to validate
oneTimeKeysIdslist of one-time public keys ids to validate
Return Value
Object with used keys ids
-
Returns public keys set for given identity
Throws
RatchetClientError.constructingUrl- Rethrows from
ServiceRequest - Rethrows from
HttpConnectionProtocol - Rethrows from
JSONDecoder - Rethrows from
BaseClient
Declaration
Swift
public func getPublicKeySet(forRecipientIdentity identity: String) throws -> PublicKeySetParameters
identityUser’s identity
Return Value
Set of public keys
-
Returns public keys sets for given identities.
Throws
RatchetClientError.constructingUrl- Rethrows from
ServiceRequest - Rethrows from
HttpConnectionProtocol - Rethrows from
JSONDecoder - Rethrows from
BaseClient
Declaration
Swift
public func getMultiplePublicKeysSets(forRecipientsIdentities identities: [String]) throws -> [IdentityPublicKeySet]Parameters
identitiesUsers’ identities
Return Value
Sets of public keys
-
Deletes keys entity
Throws
RatchetClientError.constructingUrl- Rethrows from
ServiceRequest - Rethrows from
HttpConnectionProtocol - Rethrows from
JSONDecoder - Rethrows from
BaseClient
Declaration
Swift
public func deleteKeysEntity() throws
RatchetClient Class Reference