fromCbor

Parses a COSE_Key map. Unknown parameters are ignored, as RFC 9052 §7 allows.

An EC2 key on P-256 or P-384 may give y as its sign bit instead of the coordinate, true for an odd y (RFC 9053 §7.1.1, a compressed point). The coordinate is computed with Sec1, so y, rawPublicKey and encode carry it in full.

Throws

for a map that is not a COSE_Key kcoap supports, among them an EC2 key without crv or y (RFC 9053 §7.1.1) and an OKP key without crv or with a y (§7.2), or a sign bit whose x is not on the curve.