Skip to content

feat: add Jwk::from_decoding_key#475

Open
eyakubovich wants to merge 1 commit into
Keats:masterfrom
eyakubovich:ey/jwk-from-decoding-key
Open

feat: add Jwk::from_decoding_key#475
eyakubovich wants to merge 1 commit into
Keats:masterfrom
eyakubovich:ey/jwk-from-decoding-key

Conversation

@eyakubovich
Copy link
Copy Markdown

Allow for constructing a Jwk from a decoding key.
This allows it to be created from a DER encoded file, for example.

This patch refactors some Jwk internals to reduce code duplication.

@Keats
Copy link
Copy Markdown
Owner

Keats commented Jan 5, 2026

That will need to wait a bit, we need to merge #452 first that has a lot of change that would overlap with some of your changes.

@eyakubovich
Copy link
Copy Markdown
Author

@Keats @arckoor PTAL. I removed JwkUtils (technically those functions are not JWK specific) and put everything up at the same level. However I added separate structs from RSA and EC component extraction, each with a from_private and from_public functions.

As an aside, why are function pointers used instead of traits?

Copy link
Copy Markdown
Collaborator

@arckoor arckoor left a comment

Choose a reason for hiding this comment

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

As an aside, why are function pointers used instead of traits?

It was what happened to work when I implemented it, I didn't explicitly choose not to use traits, there wasn't any deep logic behind it.
I didn't necessarily plan for more stuff being added in the future

Comment thread src/crypto/mod.rs
Comment thread src/crypto/mod.rs Outdated
Comment thread src/crypto/mod.rs Outdated
Comment thread src/crypto/rust_crypto/mod.rs Outdated
Comment thread src/crypto/mod.rs Outdated
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch 2 times, most recently from 4e8bd5f to 7a64e5d Compare January 15, 2026 19:42
@eyakubovich eyakubovich requested a review from arckoor January 15, 2026 19:42
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch 2 times, most recently from 89c40ef to 4cf5422 Compare January 16, 2026 07:37
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch from 4cf5422 to d648c85 Compare January 30, 2026 06:04
@eyakubovich
Copy link
Copy Markdown
Author

Ping. I addressed the comments. Please unlock the workflows to run the checks.

Comment thread src/jwk.rs
Comment thread src/jwk.rs Outdated
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch 2 times, most recently from e7c7b58 to c065e8c Compare February 10, 2026 03:24
Comment thread src/jwk.rs Outdated
Allow for constructing a Jwk from a decoding key.
This allows it to be created from a DER encoded file, for example.

This patch flattens JwkUtils but adds separate structs for RSA and EC
component extraction.
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch from c065e8c to b7754f5 Compare February 10, 2026 16:57
@arckoor
Copy link
Copy Markdown
Collaborator

arckoor commented May 12, 2026

Please rebase to latest master. A bunch of other PRs are also adding more utility functions to JwkUtils, so I think keeping that struct around is better in the long run, the CryptoProvider grows uncomfortably big otherwise. Though renaming it to something like KeyUtils or similar wouldn't hurt

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