OhttpSessionProtocol

public protocol OhttpSessionProtocol : AnyObject

Each OHTTP request-reply exchange needs to create an OhttpSession object to manage encryption state.

  • Decypt and unpack the response from the Relay for the previously encapsulated request. You must use the same OhttpSession that generated the request message.

    Declaration

    Swift

    func decapsulate(encoded: [UInt8]) throws -> OhttpResponse
  • Encapsulate an HTTP request as Binary HTTP and then encrypt that payload using HPKE. The caller is responsible for sending the resulting message to the Relay.

    Declaration

    Swift

    func encapsulate(method: String, scheme: String, server: String, endpoint: String, headers: [String : String], payload: [UInt8]) throws -> [UInt8]