EdhocPeerErrorException

class EdhocPeerErrorException @JvmOverloads constructor(error: EdhocError, val retryWith: CipherSuite? = null) : EdhocException(source)

The peer sent an EDHOC error message instead of the expected message. No error is sent back (errorMessage is null): error messages are never answered (RFC 9528 §6, §6.1).

The session is aborted, except in one case, which retryWith tells apart: the Responder answered message_1 with error code 2 and SUITES_R names a suite the Initiator prefers and its crypto backend runs (RFC 9528 §6.3.1). Then the Initiator is back at EdhocPhase.START with that suite selected, and EdhocInitiator.createMessage1 starts the next attempt.

Constructors

Link copied to clipboard
constructor(error: EdhocError, retryWith: CipherSuite? = null)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard

The error to report: what the peer is told, and why this side failed.

Link copied to clipboard

ERR_CODE of error.

Link copied to clipboard
open override val errorMessage: ByteArray?

The error message to send to the peer, or null when there is nothing to answer: the peer sent an error itself (RFC 9528 §6), or the failure happened before any message was received.

Link copied to clipboard
expect open val message: String?
Link copied to clipboard

The suite selected for the next message_1 when the Initiator can retry after error code 2 (RFC 9528 §6.3.1), or null when the session is aborted.