Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Directly ingest naked COSE key #336

Open
chrysn opened this issue Jan 29, 2025 · 0 comments
Open

feature: Directly ingest naked COSE key #336

chrysn opened this issue Jan 29, 2025 · 0 comments

Comments

@chrysn
Copy link
Collaborator

chrysn commented Jan 29, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant