RatchetChannel

@objc(VTERatchetChannel)
open class RatchetChannel : NSObject

Class representing Ratchet Channel

  • Participant

    Declaration

    Swift

    @objc
    public var participant: String { get }

Extension with double ratchet encrypt and decrypt operations

  • Encrypts data

    Declaration

    Swift

    @objc
    open func encrypt(data: Data) throws -> Data

    Parameters

    data

    Data to encrypt

  • Decrypts data

    Declaration

    Swift

    @objc
    open func decrypt(data: Data, updateSession: Bool = true) throws -> Data

    Parameters

    data

    encrypted Data

    updateSession

    update session state in storage

  • Encrypts string

    Declaration

    Swift

    @objc
    open func encrypt(text: String) throws -> String

    Parameters

    text

    String to encrypt

  • Decrypts string

    Declaration

    Swift

    @objc
    open func decrypt(text: String, updateSession: Bool = true) throws -> String

    Parameters

    data

    encrypted Data

    updateSession

    update session state in storage

  • Encrypts array of data

    Declaration

    Swift

    @objc
    open func encryptMultiple(data: [Data]) throws -> [Data]

    Parameters

    data

    array of data to encrypt

  • Decrypts array of data

    Important

    data should be in strict order by encryption time

    Declaration

    Swift

    @objc
    open func decryptMultiple(data: [Data]) throws -> [Data]

    Parameters

    data

    array of data to decrypt

  • Encrypts array of string

    Declaration

    Swift

    @objc
    open func encryptMultiple(text: [String]) throws -> [String]

    Parameters

    text

    array of string to encrypt

  • Decrypts array of string

    Important

    string should be in strict order by encryption time

    Declaration

    Swift

    @objc
    open func decryptMultiple(text: [String]) throws -> [String]

    Parameters

    text

    array of string to decrypt