Giter VIP home page Giter VIP logo

Comments (6)

zaczkows avatar zaczkows commented on August 16, 2024

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.

XAMPPRocky avatar XAMPPRocky commented on August 16, 2024

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.

XAMPPRocky avatar XAMPPRocky commented on August 16, 2024

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.

zaczkows avatar zaczkows commented on August 16, 2024

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.

XAMPPRocky avatar XAMPPRocky commented on August 16, 2024

I've an idea on how to implement it SET encoding, I'll try to implement it soon.

from rasn.

XAMPPRocky avatar XAMPPRocky commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.