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

Add pem/der loaders to PublicKey #265

Merged
merged 8 commits into from
Feb 17, 2025
Merged

Add pem/der loaders to PublicKey #265

merged 8 commits into from
Feb 17, 2025

Conversation

Geal
Copy link
Contributor

@Geal Geal commented Feb 4, 2025

rebase of #212 over main

PEM key loading is only supported for ed25519 right now (so the relevant methods on the common KeyPair etc types are removed). Do we add it for p256 curves?

Expose pem feature in biscuit-parser crate as well
Copy link

codspeed-hq bot commented Feb 4, 2025

CodSpeed Performance Report

Merging #265 will not alter performance

Comparing geal/pem-fixes (0fc8a57) with main (8dabc87)

Summary

✅ 12 untouched benchmarks

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 96.72131% with 2 lines in your changes missing coverage. Please review.

Project coverage is 68.61%. Comparing base (8dabc87) to head (0fc8a57).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
biscuit-auth/src/crypto/mod.rs 95.55% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #265      +/-   ##
==========================================
+ Coverage   67.23%   68.61%   +1.38%     
==========================================
  Files          39       39              
  Lines        7407     7424      +17     
==========================================
+ Hits         4980     5094     +114     
+ Misses       2427     2330      -97     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Geal Geal requested a review from divarvel February 8, 2025 21:44
@divarvel
Copy link
Collaborator

PEM key loading is only supported for ed25519 right now (so the relevant methods on the common KeyPair etc types are removed). Do we add it for p256 curves?

yes, that would be great to have PEM support for both algorithms and for private and public keys

…ivate keys

The pem/der payloads contain information about the key algorithm. Unfortunately we can’t easily extract it ahead of time, but we can try for each supported algorithms. Key parsing is typically a one-time operation, so it’s ok to do it this way.
@Geal Geal merged commit 01e2276 into main Feb 17, 2025
7 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