EdhocClientHandshake

constructor(config: EdhocInitiatorConfig, crypto: CryptoBackend, server: CoapUri, path: String = EdhocOverCoap.WELL_KNOWN_PATH, loggerFactory: LoggerFactory = LoggerFactory.Global, sequenceStore: SequenceNumberStore? = null, exchange: suspend (CoapRequest) -> CoapResponse)(source)

Parameters

server

the scheme, host and port of the server; its path and query are not used.

path

the EDHOC resource on server, .well-known/edhoc (RFC 9528 §10.7) unless the server mounts it elsewhere, as discovery with resource type core.edhoc tells.

loggerFactory

where the handshake's logger comes from, under LogTags.EDHOC.

sequenceStore

holds the Sender Sequence Numbers of the contexts this handshake derives. By default (null) each context gets its own EphemeralSequenceNumberStore, which fits EDHOC, whose keys are new with every session, and goes away with the context. Pass a durable store to resume a context after a restart, as oscoreParameters describes. The store keeps one limit per context name, "sid=C_R,rid=C_I" (dev.kcoap.oscore.SecurityContextParameters.name), and those names are not unique across servers: each server chooses its C_R on its own, and nothing on this side makes C_I unique. Two live contexts with one name in one store break its contract and can lead to AEAD nonce reuse after a restore (RFC 8613 Appendix B.1.1), so give every server its own durable store, or a store that puts a name of the server in front of the context names (and restore with the same one).

exchange

sends one request and returns its response.