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

change signature of signed_by to accept &impl AsRef<CertificateParams> issuer #307

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

audunhalland
Copy link
Contributor

I had the issue that I wanted to use an issuer that was a CertificateParams, not a Certificate (because CertificateParams can be deserialized from file, but Certificate can not). The best solution I've found is to change the signature to accept &impl AsRef<CertificateParams>, and then implement that AsRef for both Certificate and CertificateParams.

I think this is also a backwards-compatible change, but I'm not 100% sure.

@djc
Copy link
Member

djc commented Jan 4, 2025

This seems like a nice improvement!

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@djc djc added this pull request to the merge queue Jan 4, 2025
Merged via the queue into rustls:main with commit b2a851f Jan 4, 2025
13 of 15 checks passed
@est31
Copy link
Member

est31 commented Jan 4, 2025

The issue with AsRef tricks is that it isn't immediately obvious what types implement AsRef<CertificateParams>. It would be nice to point it out in the docs that both Certificate and CertificateParams implement it.

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.

4 participants