RatchetClientProtocol

@objc(VSRRatchetClientProtocol)
public protocol RatchetClientProtocol

Client used to communicate with ratchet service

  • 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

    Depends on implementation

    Declaration

    Swift

    @objc
    func uploadPublicKeys(identityCardId: String?,
                          longTermPublicKey: SignedPublicKey?,
                          oneTimePublicKeys: [Data]) throws

    Parameters

    identityCardId

    Identity cardId that should be available on Card service.

    longTermPublicKey

    long-term public key + its signature created using identity private key. Should be curve25519 in PKCS#8

    oneTimePublicKeys

    one-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

    Depends on implementation

    Declaration

    Swift

    @objc
    func validatePublicKeys(longTermKeyId: Data?,
                            oneTimeKeysIds: [Data]) throws -> ValidatePublicKeysResponse

    Parameters

    longTermKeyId

    long-term public key id to validate

    oneTimeKeysIds

    list of one-time public keys ids to validate

    Return Value

    Object with used keys ids

  • Returns public keys set for given identity.

    Throws

    Depends on implementation

    Declaration

    Swift

    @objc
    func getPublicKeySet(forRecipientIdentity identity: String) throws -> PublicKeySet

    Parameters

    identity

    User’s identity

    Return Value

    Set of public keys

  • Returns public keys sets for given identities.

    Throws

    Depends on implementation

    Declaration

    Swift

    @objc
    func getMultiplePublicKeysSets(forRecipientsIdentities identities: [String]) throws -> [IdentityPublicKeySet]

    Parameters

    identities

    Users’ identities

    Return Value

    Sets of public keys

  • Deletes keys entity

    Throws

    Depends on implementation

    Declaration

    Swift

    @objc
    func deleteKeysEntity() throws