SecurityContextParameters

class SecurityContextParameters(masterSecret: ByteArray, senderId: ByteArray, recipientId: ByteArray, masterSalt: ByteArray = ByteArray(0), idContext: ByteArray? = null, val aeadAlgorithm: AeadAlgorithm = AeadAlgorithm.AES_CCM_16_64_128, val hkdfAlgorithm: HashAlgorithm = HashAlgorithm.SHA_256, val includeIdContext: Boolean = false, val replayWindowSize: Int = 32)(source)

The input parameters of an OSCORE security context (RFC 8613 §3.2), as agreed out of band or derived by EDHOC. SecurityContext.derive turns them into keys.

Parameters

masterSecret

the Master Secret; required.

senderId

this endpoint's Sender ID; the empty string is legitimate.

recipientId

the peer's Sender ID.

masterSalt

the Master Salt; empty by default.

idContext

the ID Context, or null when none is used.

includeIdContext

whether requests carry the ID Context as 'kid context' (RFC 8613 §5.1), for servers that select contexts by it.

replayWindowSize

the anti-replay window, 32 by default (§3.2.2); at most 64.

Constructors

Link copied to clipboard
constructor(masterSecret: ByteArray, senderId: ByteArray, recipientId: ByteArray, masterSalt: ByteArray = ByteArray(0), idContext: ByteArray? = null, aeadAlgorithm: AeadAlgorithm = AeadAlgorithm.AES_CCM_16_64_128, hkdfAlgorithm: HashAlgorithm = HashAlgorithm.SHA_256, includeIdContext: Boolean = false, replayWindowSize: Int = 32)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A stable name for persistence and logs: the IDs, never the secret.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

A copy of the Master Salt; secret-derived when EDHOC exported it (RFC 9528 Appendix A.1).

Link copied to clipboard

A copy of the Master Secret, for provisioning and persistence code. A function, so every copy of the secret shows at the call site; wipe the copy when done with it.

Link copied to clipboard
open override fun toString(): String