-
Notifications
You must be signed in to change notification settings - Fork 137
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
der: Any vs AnyRef: issues with generating AlgorithmIdentifier's parameters on the fly #731
Comments
Yeah, in the next breaking release of |
Note that this might be possible to do in a non-breaking manner today if you'd like to experiment with it |
Do you have any particular ideas/suggestions? I wanted to make add the ability to use any ASN.1 tag in place of |
I'm suggesting replacing
|
@tarcieri although it's a separate issue, the (in case of |
@lumag the alternative to using a There's a tradeoff to be made there: owned types aren't zero-copy, but if you're decoding from PEM zero-copy isn't possible anyway. The reason the Making |
I took a look at trying to make the parameters generic. AFAICT it's not possible without a breaking change, because it involves removing the While I could add a So I think our best bet is to remove the lifetime in the next breaking release, and add a |
@tarcieri I did not try to implement any actual code proposals. However having the distinct |
The owned vs borrowed distinction is pretty fundamental to Rust: the duplication occurs because borrowed types have a lifetime and owned types don't. It's also something you'll see in most Rust serialization frameworks including Generics make it possible to abstract over the distinction in many cases, including However, for the Or rather, if we do (re-)add reference-based types to |
Alternatively, there are crates for abstracting over the owned/borrowed distinction, for example: https://docs.rs/yoke/ That might work well with Edit: opened #734 to discuss a potential |
I tried writing a function that returns complete
AlgorithmIdentifier
for the RSASSA-PSS algorithm. However my attempts to write a sensible one have failed up to now, as it's not possible to embed an owned value into theparameters
field (AnyRef
). I ended up declaring static byte array with the PSS parameters in DER encoding, but it is not really intuitive.The text was updated successfully, but these errors were encountered: