-
Notifications
You must be signed in to change notification settings - Fork 120
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
const-oid: add borrowed form of OID (e.g. ObjectIdentifierRef) #266
Comments
Adds an enum representing `ANY`, `NULL`, and `Objectidentifier` cases for the `parameters` field of `AlgorithmIdentifier`. Ideally this enum would be unnecessary and we could just use the `der::Any` type for this field, however to make that possible in all relevant use cases we'd need a reference-based type for `ObjectIdentifier` backed by a byte slice containing the DER serialization of the OID. See: #266 Until we have such a type, this enum suffices to make it possible to decode and encode an owned OID value which stores the decoded arcs that comprise it, rather than the DER serialization.
Adds an enum representing `ANY`, `NULL`, and `Objectidentifier` cases for the `parameters` field of `AlgorithmIdentifier`. Ideally this enum would be unnecessary and we could just use the `der::Any` type for this field, however to make that possible in all relevant use cases we'd need a reference-based type for `ObjectIdentifier` backed by a byte slice containing the DER serialization of the OID. See: #266 Until we have such a type, this enum suffices to make it possible to decode and encode an owned OID value which stores the decoded arcs that comprise it, rather than the DER serialization.
This might still be useful, but for what it's worth there is now a conversion available from https://docs.rs/der/0.2.10/der/struct.Any.html#impl-From%3C%26%27a%20ObjectIdentifier%3E |
Closing this out as the conversion from Please leave a comment if you'd like this reopened. |
In certain cases it would be nice to be able to have a "borrowed" type which is backed by a byte slice containing the BER/DER encoding of an OID. This would be particularly nice in conjunction with the
der::Any
type, allowing conversions backed by references.With a sufficiently powerful
const fn
we could even accept the OID as an array of integer arcs (or ideally, even a string!) and handle encoding the DER serialization at compile time. This is also possible with proc macros but ideally we could avoid those.The text was updated successfully, but these errors were encountered: