Skip to content

feature: Directly ingest naked COSE key #336

@chrysn

Description

@chrysn

The parse_ccs() Credential constructor takes a full CCS. RFC9528 Section 3.5.2 also describes that naked COSE keys can be used (and I think are common in ACE EDHOC profile) that are turned into a CCS by prefixing them with A108A101.

I suggest (and will probably later PR) to add a dress_cosekey() constructor that takes only a COSE key, extracts the key (possibly refactoring with parse_ccs) and adds the prefix. This is a minor usability help, but saves downstream crates from carrying a 4-byte magic byte sequence around.

Ideally, that parsing function should be less strict than what parse_ccs does now; in particular, it should support EC2 keys where only the X coordinate is given (as is sufficient for ECDH), and which have no kid is present. Is there any particular reason why this (and a subject) is required in parse_ccs(), other than that parse_ccs() was originally designed to ingest test vectors where those happened to be present?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions