OhttpSession

open class OhttpSession:
    OhttpSessionProtocol

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

  • Declaration

    Swift

    required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer)
  • Initialize encryption state based on specific Gateway key config

    Declaration

    Swift

    public convenience init(config: [UInt8]) throws
  • 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

    open 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

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