TrustedCredentials
A CredentialResolver over a fixed set of trusted credentials:
kidmatches credentials whose AuthenticationCredential.kid equals it;x5tmatches X.509 credentials whose thumbprint equals it;kccsis accepted when an identical CCS is trusted (raw public keys are their own trust anchors, RFC 9528 Appendix D.3);x5chainis accepted when its end-entity certificate is trusted, or else when certificateValidator accepts the chain.
What is trusted with and without a certificateValidator:
Without one, only the pinned credentials are trusted. A chain whose end-entity certificate is not pinned fails closed.
With one, every chain the validator accepts authenticates, whoever its end entity is: the validator says the chain leads to a trust anchor, not that this peer may connect. Authorize afterwards, on EdhocSession.peerCredential (its AuthenticationCredential.certificate) and EdhocSession.peerCredentialIdentifier, or in a resolver that wraps this one:
val resolver = CredentialResolver { id ->
trusted.resolve(id).filter { it.certificate?.subjectCommonName in allowedNames }
}No CertificateValidator implementation ships with kcoap yet. A validator that accepts every chain, such as an empty test stub, makes any certificate authenticate, self-signed ones included.
Constructors
Functions
The trusted credentials identifier may refer to, most likely first.