Skip to content

feat: CoseAlgorithm enum with RFC 9864 fully-specified identifiers#9

Merged
mingweishih merged 1 commit intoAzure:mainfrom
mingweishih:alg
Apr 17, 2026
Merged

feat: CoseAlgorithm enum with RFC 9864 fully-specified identifiers#9
mingweishih merged 1 commit intoAzure:mainfrom
mingweishih:alg

Conversation

@mingweishih
Copy link
Copy Markdown
Contributor

@mingweishih mingweishih commented Apr 17, 2026

Add typed CoseAlgorithm enum replacing raw i64 for the COSE alg field in ProtectedCorimHeaderMap and SignedCorimBuilder.

New fully-specified algorithms per RFC 9864:

  • ESP256 (-9), ESP384 (-51), ESP512 (-52) replace ES256/ES384/ES512
  • Ed25519 (-19), Ed448 (-53) replace EdDSA

Deprecated polymorphic algorithms retained for decode interop:

  • ES256 (-7), ES384 (-35), ES512 (-36), EdDSA (-8)
  • is_deprecated() method identifies these

PS256/PS384/PS512 unchanged (not deprecated per RFC 9864 s6.1). Unknown(i64) variant for forward compatibility.
SignedCorimBuilder::new() accepts impl Into.

CLI: uses CoseAlgorithm::Display, removed duplicate cose_alg_name.
RFC_REFERENCES.md: added RFC 9864 section.

631 tests, 0 clippy warnings.

Description

Related Issues

Checklist

  • I have read the CONTRIBUTING guidelines
  • All new source files include the Microsoft copyright header
  • New public APIs have doc comments
  • Tests have been added or updated
  • cargo test --all passes
  • cargo fmt --all -- --check passes
  • cargo clippy --all -- -D warnings passes

Add typed CoseAlgorithm enum replacing raw i64 for the COSE alg field
in ProtectedCorimHeaderMap and SignedCorimBuilder.

New fully-specified algorithms per RFC 9864:
- ESP256 (-9), ESP384 (-51), ESP512 (-52) replace ES256/ES384/ES512
- Ed25519 (-19), Ed448 (-53) replace EdDSA

Deprecated polymorphic algorithms retained for decode interop:
- ES256 (-7), ES384 (-35), ES512 (-36), EdDSA (-8)
- is_deprecated() method identifies these

PS256/PS384/PS512 unchanged (not deprecated per RFC 9864 s6.1).
Unknown(i64) variant for forward compatibility.
SignedCorimBuilder::new() accepts impl Into<CoseAlgorithm>.

CLI: uses CoseAlgorithm::Display, removed duplicate cose_alg_name.
RFC_REFERENCES.md: added RFC 9864 section.

631 tests, 0 clippy warnings.
@mingweishih mingweishih merged commit ab6d7af into Azure:main Apr 17, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants