Shouldn't `jwk.import_from_pyca` also provide a `kid` param and set it to `thumbprint()` by default?
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start in jwcrypto/jwk.py at import_from_pyca (around line 1012) and compare it with import_from_pem's handling of kid. Check how thumbprint() is used there and how JWKSet.export treats keys without a kid. Done when import_from_pyca can accept an optional kid and defaults it consistently, with tests covering both an explicit kid and the default case.
Written by the indexing model from the issue text.
Description
When importing from a pem file (import_from_pem), the kid can be set or if not, it uses the thumbprint() by default.
Especially when the jwk is added to a jwks afterwards - and potentially multiple keys are in the jwks, a kid would be required to identify the right key.
Example workaround:
pub_jwk.import_from_pyca(pub_key)
pub_jwk['kid'] = pub_jwk.thumbprint()
jwks = JWKSet()
jwks.add(pub_jwk)
jwks_export = jwks.export(private_keys=False, as_dict=True)
Anything I'm doing wrong here?
Thanks,
Matthias
- Dominant language
- Python
- Stars
- 478
- Forks
- 132
- Avg merge
- 7h 38m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from latchset/jwcrypto
-
Difficulty 2/5 Half a day Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
Teak and implement HPKE once the RFC is publishedPossibly taken @rjeffman claimed this 96 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
enhancement
Difficulty 4/5 Over a week Newbie friendliness 24/100
All issues in latchset/jwcrypto
Similar issues
-
cognition facet:consolidation memory ready size:S
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
proposal
Difficulty 1/5 Under an hour Newbie friendliness 68/100
j3ko/agent-plugins#29 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Gathin23/cleanyourtv#4026 ·
Maintainers usually reply within 1 day