Skip to content

Conversation

@kentakayama
Copy link

Calculates canonical (deterministic) thumbprint from fields of Key.
https://www.rfc-editor.org/info/rfc9679

Signed-off-by: Ken Takayama <[email protected]>
…lidate() function.

Since validate() performs extensive checks, it may raise errors that are not critical for COSE Key Thumbprint (RFC 9679) calculation.

Signed-off-by: Ken Takayama <[email protected]>
@kentakayama
Copy link
Author

As noted in Pull Request #223, the behavior of Key.validate() has changed, which also affects the error codes received in the Thumbprint() test cases.
If #223 is merged, I will add another commit to ensure Thumbprint() produces the intended error codes.

Copy link
Contributor

@OR13 OR13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I think we should add this

@thomas-fossati
Copy link
Contributor

As noted in Pull Request #223, the behavior of Key.validate() has changed, which also affects the error codes received in the Thumbprint() test cases. If #223 is merged, I will add another commit to ensure Thumbprint() produces the intended error codes.

Is that the reason why TestKey_Thumbprint fails at present?

@thomas-fossati
Copy link
Contributor

Hey @kentakayama , thanks for the PR!

You requested reviews, but it's still marked as a draft.
Could you please clarify its status?

cheers!

@kentakayama
Copy link
Author

kentakayama commented Dec 4, 2025

Hey @kentakayama , thanks for the PR!

You requested reviews, but it's still marked as a draft. Could you please clarify its status?

cheers!

@thomas-fossati
Sorry for the confusion. At first I thought this Pull Request was “perfect!” and submitted it in a non‑Draft state.
However, I realized that many of the checks for computing the Thumbprint overlap with the validate() function, which isn’t great from a maintainability perspective, so I switched it back to Draft.
As a result, it’s now in the state of “review requested but Draft.”

While looking more closely at the validate() function, I revisited RFC 9053 in light of the COSE Key Thumbprint functionality, and I started to think that perhaps it should be handled as in #223.
I believe it might be better to discuss that first.
In fact, because the error checking in #223 was made stricter, the expected error codes in the Thumbprint test cases have also changed, so I think #223 should be resolved first.

@thomas-fossati
Copy link
Contributor

@thomas-fossati Sorry for the confusion. At first I thought this Pull Request was “perfect!” and submitted it in a non‑Draft state. However, I realized that many of the checks for computing the Thumbprint overlap with the validate() function, which isn’t great from a maintainability perspective, so I switched it back to Draft. As a result, it’s now in the state of “review requested but Draft.”

While looking more closely at the validate() function, I revisited RFC 9053 in light of the COSE Key Thumbprint functionality, and I started to think that perhaps it should be handled as in #223. I believe it might be better to discuss that first. In fact, because the error checking in #223 was made stricter, the expected error codes in the Thumbprint test cases have also changed, so I think #223 should be resolved first.

Thank you for taking the time to explain it to me so clearly.

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.

3 participants