Skip to content

feat: add Jwk::from_decoding_key#475

Merged
arckoor merged 1 commit into
Keats:masterfrom
eyakubovich:ey/jwk-from-decoding-key
Jun 9, 2026
Merged

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

Conversation

@eyakubovich

Copy link
Copy Markdown
Contributor

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

Keats commented Jan 5, 2026

Copy link
Copy Markdown
Owner

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
Contributor 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?

@arckoor arckoor left a comment

Copy link
Copy Markdown
Collaborator

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 Outdated
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
Contributor 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
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch from c065e8c to b7754f5 Compare February 10, 2026 16:57
@arckoor

arckoor commented May 12, 2026

Copy link
Copy Markdown
Collaborator

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

@eyakubovich

Copy link
Copy Markdown
Contributor Author

Rebased, brought back the struct and called it KeyUtils.

Comment thread src/crypto/mod.rs Outdated
Comment thread src/jwk.rs Outdated
Comment thread src/jwk.rs

@arckoor arckoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM after the nits

Comment thread src/crypto/mod.rs Outdated
Comment thread src/crypto/aws_lc/mod.rs Outdated
Comment thread src/crypto/rust_crypto/mod.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 renames JwkUtils to KeyUtils.
@eyakubovich eyakubovich force-pushed the ey/jwk-from-decoding-key branch from 1e6562e to 14b87c1 Compare June 8, 2026 21:45
@arckoor arckoor merged commit e681247 into Keats:master Jun 9, 2026
10 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.

3 participants