EdhocResource

class EdhocResource(edhoc: EdhocServer, name: String = "edhoc") : CoapResource(source)

The EDHOC resource of a CoAP server (RFC 9528 Appendix A.2): POST requests are handed to edhoc. Mount it under .well-known for the default path:

CoapServer(transport, scope, config) {
resource(".well-known") { add(EdhocResource(edhoc)) }
}

It is listed in /.well-known/core with resource type core.edhoc (RFC 9528 §10.10), so clients can discover it.

It is AccessPolicy.Public of its own, whatever the server's default: EDHOC runs before any OSCORE context exists, and authenticates the peer itself (RFC 9528 §3.5). With message security configured, the server's other resources refuse requests without it (ADR 0008).

Constructors

Link copied to clipboard
constructor(edhoc: EdhocServer, name: String = "edhoc")

Properties

Link copied to clipboard
open override val access: AccessPolicy
Link copied to clipboard
open override val attributes: ResourceAttributes
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun find(segments: List<String>): CoapResource?
Link copied to clipboard
open suspend fun handle(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend fun handleDelete(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend fun handleFetch(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend fun handleGet(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend fun handleIPatch(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend fun handlePatch(context: RequestContext): CoapResponse
Link copied to clipboard
open suspend override fun handlePost(context: RequestContext): CoapResponse

The body of the POST and the peer it came from are all EdhocServer.handle needs.

Link copied to clipboard
open suspend fun handlePut(context: RequestContext): CoapResponse
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String