EdhocIdentity

class EdhocIdentity(val oscore: OscoreIdentity, val peerCredential: AuthenticationCredential, val peerCredentialIdentifier: CredentialIdentifier) : SecurityIdentity(source)

The peer behind the requests an OSCORE context verifies when an EDHOC session established that context (RFC 9528 Appendix A.1): the authentication credential EDHOC verified for the peer, and the context's OSCORE identity. oscoreContext attaches it to the context it derives (dev.kcoap.oscore.SecurityContext.identity), so EdhocServer's contexts carry it, and resource handlers and access policies see it as the request's securityIdentity (ADR 0008).

Authorize on peerCredential: it is what EDHOC authenticated (RFC 9528 §3.5), and it belongs to the context, whereas the Recipient ID in oscore is a connection identifier the server allocated (RFC 9668 §4.1.2), which a later session may get again once this context is gone.

resource("lights") {
access = AccessPolicy { request ->
(request.securityIdentity as? EdhocIdentity)?.peerCredential in operators
}
}

Two are equal when their OSCORE identities and credentials are, however the credential was identified.

Constructors

Link copied to clipboard
constructor(oscore: OscoreIdentity, peerCredential: AuthenticationCredential, peerCredentialIdentifier: CredentialIdentifier)

Properties

Link copied to clipboard
open override val description: String
Link copied to clipboard

the Recipient ID and ID Context of the context.

Link copied to clipboard

the peer's authentication credential, CRED_I or CRED_R, as EDHOC verified it.

Link copied to clipboard

how the peer identified peerCredential in the handshake, ID_CRED_I or ID_CRED_R (RFC 9528 §3.5.3).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String