Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know why you think this; the asn1-rust crate is in fact used to implement not only X.509 certificate decoding[1] but also path validation[2].

Edit: Here's an example of a CHOICE implemented with rust-asn1 that has more than three variants[3].

[1]: https://cryptography.io/en/latest/x509/reference/

[2]: https://cryptography.io/en/latest/x509/verification/

[3]: https://github.com/pyca/cryptography/blob/be6c53dd03172dde6a...



The asn1 crate provides three builtin Choice enums itself - asn1::{Choice1, Choice2, Choice3} - which support 1, 2 and 3 choices respectively. I assume that is what lilyball is referring to. But as you correctly point out the custom derive supports mapping enums with more variants to CHOICE just fine, so the builtin enums are not a relevant limitation.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: