EdhocOverCoap

How EDHOC messages travel in CoAP messages (RFC 9528 Appendix A.2, forward message flow): POST requests to /.well-known/edhoc and 2.04 responses. Requests are prefixed so the server can correlate them: message_1 with the CBOR value true, later messages with the server's C_R.

These are pure request and response builders and a payload parser, in the application model of kcoap-coap (CoapRequest, CoapResponse); EdhocServer and EdhocClientHandshake put them to work.

Types

Link copied to clipboard
sealed interface ServerRequest

What a server found in the payload of a request to its EDHOC resource.

Properties

Link copied to clipboard

RFC 9528 §10.10: the resource type clients use to discover an EDHOC resource.

Link copied to clipboard

RFC 9528 §10.7.

Functions

Link copied to clipboard

2.04 Changed without payload, when message_3 completes a session without message_4.

Link copied to clipboard
fun continuationRequest(resource: CoapUri, responderId: ConnectionIdentifier, message: ByteArray): CoapRequest

POST to the EDHOC resource resource carrying C_R, message, for message_3 or an error message in the forward flow (RFC 9528 Appendix A.2.1).

Link copied to clipboard
fun errorResponse(errorMessage: ByteArray, isServerError: Boolean = false): CoapResponse

An EDHOC error message in an error response (RFC 9528 Appendix A.2.3): 4.00 for client errors, 5.00 for server errors, Content-Format application/edhoc+cbor-seq.

Link copied to clipboard
fun message1Request(resource: CoapUri, message1: ByteArray): CoapRequest

POST to the EDHOC resource resource carrying true, message_1 (Content-Format application/cid-edhoc+cbor-seq, RFC 9528 Appendix A.2.1).

Link copied to clipboard

2.04 Changed carrying message_2 or message_4 (Content-Format application/edhoc+cbor-seq).

Link copied to clipboard

Splits the payload of a request to the EDHOC resource into its prefix and the EDHOC message.