Skip to content

Conversation

@baloo
Copy link
Member

@baloo baloo commented Dec 18, 2022

This introduces the owned api for x509 certificates.

@baloo baloo force-pushed the baloo/owned-api/parameterized-cert branch from fd3ead8 to 37c874a Compare December 18, 2022 05:37
@baloo baloo force-pushed the baloo/owned-api/parameterized-cert branch from 37c874a to 89aff8f Compare December 18, 2022 05:37
@baloo
Copy link
Member Author

baloo commented Dec 18, 2022

I am not very happy with those changes on the derive crate. The management of lifetimes is a hack.
(at that point, might as well fix the TODO for managing multiple lifetimes)

}

impl<'a> TbsCertificate<'a> {
impl<SignParams, KeyParams, Key> TbsCertificate<SignParams, KeyParams, Key> {
Copy link
Member

@tarcieri tarcieri Dec 18, 2022

Choose a reason for hiding this comment

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

Rather than making these generic, I think they can just be fixed to Any, Any, and BitString respectively, at least for now.

That will give you a fully owned representation of TbsCertificate and Certificate which can also handle any kind of signature algorithm, without the additional complexity of generics and variadic representations.

If you really do want to make it generic, I would suggest adding something like pub trait Profile to be impl'd on ZSTs which can act as a carrier for families of type parameters (and potentially constant values as well), rather than using a large number of generic parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's go with fully own for now, but I'll resubmit another PR to follow up on the profile idea.
I think it will ease things a lot on the derive as I can encode bounds on the trait instead. It could very much help with bringing non-owned extensions back as well.

@baloo
Copy link
Member Author

baloo commented Dec 18, 2022

replaced by #803

@baloo baloo closed this Dec 18, 2022
tarcieri pushed a commit that referenced this pull request Dec 30, 2022
As discussed in #803 let's make `Certificate` an owned type
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.

2 participants