Open DemiMarie opened 1 week ago
See ample related discussion in #689 for the encoding side of things.
We pretty much went in the opposite direction in #765 and leaned further into the existing hard dependency on alloc
.
In some other crates, notably spki
and the latest prereleases of pkcs8
, we do abstract over the owned and borrowed forms using generics:
https://docs.rs/pkcs8/0.11.0-rc.1/pkcs8/struct.PrivateKeyInfo.html
This has the following forms, one of which has a lifetime and the other does not:
We could potentially do something like that with x509-cert
as well, though we already use generics to carry a profile ZST, so it might become a lot of generic parameters, which makes the API more cumbersome.
WebPKI supports this, as does my own barebones-x509 crate.