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

Missing "x5c" key for serialized ECKey and others. #165

Open
sallner opened this issue Jul 26, 2024 · 2 comments
Open

Missing "x5c" key for serialized ECKey and others. #165

sallner opened this issue Jul 26, 2024 · 2 comments
Assignees

Comments

@sallner
Copy link

sallner commented Jul 26, 2024

Hello and thanks for the good work on this library.

While I was using it I came across one inconsistency with respect to handling x5c certificates on various asymmetric keys. It looks that in principle

JWK.__init__(self, kty, alg, use, kid, x5c, x5t, x5u, **kwargs)
will store the x5c on the key instance but only for RSAKeys this is also included in serialize().
if self.x5c:
res["x5c"] = [as_unicode(x) for x in self.x5c]

Is this intentional? In principal I see no problem, that also other asymmetric keys could have a x5c certificate attached to it, in particular the ECKey.
Would you consider this a reasonable change?

@jschlyter
Copy link
Collaborator

I believe it is reasonable to include x5c for all keys - please submit a PR (with tests)

@jschlyter jschlyter self-assigned this Jul 26, 2024
@sallner
Copy link
Author

sallner commented Jul 29, 2024

Thanks for the positive feedback. I will try to sort out the CLA with my employer and come back to this ASAP.

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

2 participants