X509Certificate

The parts of an X.509 certificate (RFC 5280) that kcoap's protocols need: the subject public key from the SubjectPublicKeyInfo, and the subject's common name for identity checks. EDHOC takes certificates as CRED_x and in x5chain (RFC 9528 §3.5.2, RFC 9360, Appendix D.2); DTLS certificate mode will take them in the same way.

This is not a validator. Chains are validated by a dev.kcoap.crypto.CertificateValidator, of which kcoap ships none yet; the parser only walks the DER structure, checks that it is one certificate with the fields of RFC 5280 §4.1, and recognizes the subject public key algorithms of SubjectPublicKeyInfo.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The DER encoding, which as a CBOR byte string is an EDHOC CRED_x (RFC 9528 §3.5.2).

Link copied to clipboard

The type of the subject public key.

Link copied to clipboard

The subject public key in the raw encoding of keyType: an uncompressed SEC1 point 04 || x || y for P-256 and P-384, also when the certificate carries it compressed, and the plain key bytes otherwise (SubjectPublicKeyInfo.publicKey).

Link copied to clipboard

The subject's commonName (OID 2.5.4.3), when it is a UTF8, printable or IA5 string.

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