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

Implement TryInto<PublicEncryptingKey> for PublicKeyComponents #582

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

Vadmeme
Copy link
Contributor

@Vadmeme Vadmeme commented Nov 10, 2024

Issues:

Resolves #581

Description of changes:

Adds impl TryInto<PublicEncryptingKey> for PublicKeyComponents.

Call-outs:

N/A

Testing:

Im not sure how to implement unit tests for this change would need a reviewer to assist with this. I tested them in my personal application and they functioned as expected.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.71%. Comparing base (c358484) to head (8d2abf8).
Report is 121 commits behind head on main.

Files with missing lines Patch % Lines
aws-lc-rs/src/rsa/key.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #582      +/-   ##
==========================================
- Coverage   95.80%   92.71%   -3.09%     
==========================================
  Files          61       67       +6     
  Lines        8143     9772    +1629     
  Branches        0     9772    +9772     
==========================================
+ Hits         7801     9060    +1259     
- Misses        342      426      +84     
- Partials        0      286     +286     

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


🚨 Try these New Features:

skmcgrail
skmcgrail previously approved these changes Nov 21, 2024
aws-lc-rs/src/rsa/key.rs Outdated Show resolved Hide resolved
@skmcgrail skmcgrail changed the title Implement PublicKeyComponents::build_encrypting_key Implement TryInto<PublicEncryptingKey> for PublicKeyComponents Nov 21, 2024
@skmcgrail skmcgrail requested a review from justsmth November 21, 2024 23:03
@@ -456,6 +457,22 @@ where
}
}

impl<B> TryInto<PublicEncryptingKey> for PublicKeyComponents<B>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure it's needed, but we could potentially have a non-consuming implementation:

impl<B> TryInto<PublicEncryptingKey> for &PublicKeyComponents<B>
...

Its use would be more cumbersome: TryInto::try_into(&public_key)? or (&public_key).try_into()?.

@justsmth justsmth merged commit 2caa7c9 into aws:main Nov 22, 2024
245 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.

Support importing RSA parameters manually for encryption with Pkcs1PublicEncryptingKey
4 participants