DatagramSecurity

Adds DTLS to a datagram transport, which is what coaps needs (RFC 7252 §9.1). kcoap-dtls will implement it; until then no implementation exists, coaps is unavailable, and the interface is ExperimentalKcoapApi because its shape may change with that first implementation.

TLS for coaps+tcp and coaps+ws is not a decorator like this one: each runtime's connector and listener does it with the TLS stack of its platform (docs/adr/0003-tls-in-connectors.md).

The transport returned by secure must:

Properties

Link copied to clipboard
abstract val modes: Set<SecurityMode>

The modes this implementation is configured for. Never contains SecurityMode.NO_SEC.

Functions

Link copied to clipboard
abstract fun secure(transport: DatagramTransport): DatagramTransport

Wraps transport so that everything it sends and receives goes through DTLS, as described above.