Comments (6)
I took a look at the code and I'm not sure if SetOf
should be set to BTreeSet
. First of all it introduces strong dependency to Ord
trait and forces values sorting. I know that DER or BER is only one of the representations, but according to warm-welcome-to-asn1-and-der:
In BER, a SET may be encoded in any order. In DER, a SET must be encoded in ascending order by tag.
A SET OF items is encoded the same way as a SET, including the tag byte of 0x31. For DER encoding, there is a similar requirement that the SET OF must be encoded in ascending order. Because all elements in the SET OF have the same type, ordering by tag is not sufficient. So the elements of a SET OF are sorted by their encoded values, with shorter values treated as if they were padded to the right with zeroes.
from rasn.
Thank you for your issue! Yeah I added that type aliases but never finished the implementation, because SET/SET OF
is quite unpopular, and in formats like PER they may or may not be encoded in ascending order, so I'm still figuring out what API would allow you to safely encode a set, without worrying about this encoding order.
from rasn.
Also if you'd be interested, I'd be willing to accept adding any IETF ASN.1 modules related RFC7030 as crates to rasn (similar to SNMP) if you're interested in sharing the implementation.
from rasn.
Yeah, sure. I can try to add at least CSR attributes decoding from RFC7030 (the rest is just usual DER certificate). However, both examples in RFC requires implementation of the SET(OF).
from rasn.
I've an idea on how to implement it SET
encoding, I'll try to implement it soon.
from rasn.
I've now implemented support for SET
types, and I've also added rasn-pkix
in standards
which can decode CA certificates. Check it out, and I'll release it a few days once I've added documentation and release notes.
from rasn.
Related Issues (20)
- 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 10
- 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
- OER encoder produces output that it can't decode HOT 5
- ia5 string decoding debug assertion reached from OER HOT 1
- OER/COER decode_sequence_of passes invalid data to bitvec load_be resulting in panic from assertion HOT 4
- Does not work in no-std environment HOT 3
- OER encoding rountrip confuses fields HOT 2
- OER/UPER/APER roundtrip fails with untagged sequence fields and optional types HOT 8
- Combination of optional fields and explicit tag ignores the option type HOT 3
- Decoding the data stream
- uper constraints not validated HOT 3
- add support for asn1 type DATE HOT 1
- Use `IntegerType` with `Encoder::encode_integer`
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.