CoseKey
class CoseKey(val keyType: CoseKeyType, val curve: CoseCurve?, x: ByteArray, y: ByteArray? = null, kid: ByteArray? = null, val algorithm: Int? = null)(source)
A public COSE_Key (RFC 9052 §7). Private parts are never modelled: private keys live in a dev.kcoap.crypto.CryptoBackend.
Map labels: kty 1, kid 2, alg 3, crv -1, x -2, y -3. AKP keys (draft-ietf-cose-dilithium) have no curve and carry their public key as pub under label -1 instead. The order of encode follows the examples in RFC 9529 (kty, kid, crv, x, y), so credentials built from this class match the traces byte for byte.