-
Notifications
You must be signed in to change notification settings - Fork 42
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
Use const-oid
crate?
#37
Comments
Thank you for your issue! However I'm not quite sure what the benefits would be for integrating the Though I haven't made an issue for it, I do also have features and improvements to the API that I'd still like to add to the OID types, and want to keep a good amount of flexibility. For example, I'd like to be write the following in the future, which would allow you to share and re-use oid arcs like you can in the ASN.1 language. oid! { iso(1), IDENTIFIED_ORGANISATION(3), DOD(6), INTERNET(6) }
oid! { ISO_IDENTIFIED_ORGANISATION_DOD_INTERNET, DIRECTORY(1) }
// Generates
const ISO_IDENTIFIED_ORGANISATION: Oid = oid![1, 3];
const ISO_IDENTIFIED_ORGANISATION_DOD: Oid = oid![ISO_IDENTIFIED_ORGANISATION, 6];
const ISO_IDENTIFIED_ORGANISATION_DOD_INTERNET: Oid = oid![DOD, 1];
const ISO_IDENTIFIED_ORGANISATION_DOD_INTERNET_DIRECTORY: Oid = oid![ISO_IDENTIFIED_ORGANISATION_DOD_INTERNET, 1]; |
Gotcha, understandable. The current code that I work with at my job uses the string |
Well just to be clear, I used macro syntax above, but what I proposed could be done in
I mean I think it would be fair to ask |
Yup that seems reasonable to me, if I decide to use it, I'll open an issue on their repo |
Hi, a friend recently made me aware of the
const-oid
crate which implementsconst fn new
on the type to allow compile-time parsing and construction of the OID from the textual representation, which I think would be quite useful to have re-exported & theDecode
andEncode
traits implemented for. As far as I can see, the only limitation is that it has a fixed-size internal representation which limits the lengths of the OID values (in bytes), but I'm not sure how much of an issue this would be in practice (it seems most, if not all, of the OIDs that I work with at my job are well below the current limit of 23 bytes for the OID, at least). I would imagine this would likely replace the currentConstOid
type inrasn
, or at least be available as an opt-in feature. Thoughts?The text was updated successfully, but these errors were encountered: