Comments (4)
I would imagine this would likely replace the current ConstOid type in rasn, or at least be available as an opt-in feature. Thoughts?
Thank you for your issue! However I'm not quite sure what the benefits would be for integrating the const-oid
crate would be. AFAICT there's only difference between the textual representation and rasn::types::ConstOid
is using ,
as a separator instead of .
. That's not enough to me to introduce a crate boundary for such a fundamental type. I would use the parser to provide it as a method if that was exposed but it only provides the type.
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];
from rasn.
Gotcha, understandable. The current code that I work with at my job uses the string .
notation pretty much everywhere which is why const-oid
caught my eye (I also think its a bit easier to read as its more compact, and avoids the need for a proc macro for parsing), and figured I'd mention it in case it was useful enough to reduce the number of competing OID types. Thank you for the quick response 😃
from rasn.
(I also think its a bit easier to read as its more compact, and avoids the need for a proc macro for parsing
Well just to be clear, I used macro syntax above, but what I proposed could be done in const
once there's the ability to have const trait
, and I am waiting on const to get more featureful to add those kinds of features.
figured I'd mention it in case it was useful enough to reduce the number of competing OID types.
I mean I think it would be fair to ask const-oid
maintainers if they'd want to add optional rasn
definitions. The conversion would be there just in const-oid
rather than rasn
. The whole point of rasn's design to allow you to reuse different types across crates. Just like how certain crates have a serde
feature to enable serialisation.
from rasn.
Yup that seems reasonable to me, if I decide to use it, I'll open an issue on their repo
from rasn.
Related Issues (20)
- Traits for macro expansion not always correctly carried with generics when using Encode/Decode HOT 2
- Prettyprint for Errors HOT 3
- Unable to round-trip with APER HOT 9
- Unable to round-trip NumericString with APER HOT 1
- Proc macro should error on unknown attributes
- Getting default value of type not currently possible when implementing codec HOT 5
- Question about DER encoding discrepancy between versions (0.7 -> 0.8) HOT 1
- Incorrect DER Encoding Order of SET OF Type HOT 1
- stack overflow when comparing &ObjectIdentifier with &[u32] HOT 1
- DER decoding of empty sequences is incredibly slow HOT 4
- UnbindRequest encodes/decodes incorrectly
- Comparing Object Identifier causes SIGSEGV HOT 2
- `index_map` and `character_map` are broken (one static map is initialized for all types, and thus doesn't work for different types)
- Breaking change in 0.12.6 breaks compilation of apple-codesign HOT 1
- Tokei lines of code badge doesn't work
- Mutable Access to Encoded Values HOT 2
- Performance of PER codec HOT 5
- Is it possible to get &[u8] for the underlying decoded value
- Standards crates (`rasn-pkix`, `rasn-ocsp`, etc.) should not enable `rasn`'s default feature HOT 2
- Failed windows builds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rasn.