EdhocServer

constructor(config: EdhocResponderConfig, crypto: CryptoBackend, contexts: MutableSecurityContextRepository, sendMessage4: Boolean = false, maxPendingSessions: Int = 64, maxPendingSessionsPerPeer: Int = 8, pendingSessionLifetime: Duration = TransmissionParameters.Default.maxTransmitWait, pendingSessionGracePeriod: Duration = 10.seconds, sequenceStore: SequenceNumberStore? = null, timeSource: TimeSource = TimeSource.Monotonic, listener: EdhocSessionListener = EdhocSessionListener { _, _ -> }, eventListener: EdhocServerEventListener = EdhocServerEventListener.None, loggerFactory: LoggerFactory = LoggerFactory.Global)(source)

Parameters

contexts

where the OSCORE context of every completed session goes, and where C_R is checked against the Recipient IDs in use.

pendingSessionLifetime

how long a session waits for message_3: by default MAX_TRANSMIT_WAIT (93 s, RFC 7252 §4.8.2), about as long as a client retransmits message_3 and waits for its answer.

pendingSessionGracePeriod

how long a session waiting for message_3 is safe from eviction: by default 10 s, a round trip and the client's processing of message_2 with time to spare. Give it at least pendingSessionLifetime to never evict, so a full server only refuses.

sequenceStore

holds the Sender Sequence Numbers of the contexts this server derives, under their names "sid=C_I,rid=C_R" (dev.kcoap.oscore.SecurityContextParameters.name). 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 contexts after a restart, as oscoreParameters describes. A name is unique only among the contexts in contexts, so do not share a durable store with contexts kept anywhere else.

listener

told of every session that completes, with its context.

eventListener

receives the EdhocServerEvents.

loggerFactory

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