ASN.1 AUTOMATIC TAGS and EXTENSIBILITY IMPLIED Attributes

旧城冷巷雨未停 提交于 2019-12-06 13:16:50

问题


I have been presented with an ASN.1 document that includes two encoding/decoding attributes;

  • AUTOMATIC TAGS
    • My understanding; the tags are defined automatically using the encoding rules unless a tag notation is present in the definition
  • EXTENSIBILITY IMPLIED
    • My understanding; types may have elements that are not defined within the ASN.1 document. If found, the encoder should silently ignore. Additionally, my decoder should also be ready to handle values with unspecified tags.

Q1: Are my understandings above correct?

Q2: w.r.t AUTOMATIC TAGS; defining automatically seems infeasible (obviously not...) but my understanding is that someEncoder would therefore assign SomeType.class with tag (for example) 0xBB; how does someDecoder know how to decode 0xBB back to SomeType?

Q2: w.r.t unspecified tags; once again, I am unsure how to pass an unspecified Tag back to something else.


回答1:


Q1. If the AUTOMATIC TAGS clause is present, all the components of the SEQUENCE and SET types and all the alternatives of the CHOICE types defined in the module are automatically tagged sequentially starting from 0. If a constructed type contains at least a manual tag (i.e. if it contains square brackets), the automatic tagging mode is switched off for this type.

Q2. The same algorithm for automatic tagging is used when writing the encoder and decoder code.

Q3. Your decoder may encounter unrecognized tags when it is communicating with a peer which has a newer version of your ASN.1 schema (which includes additional components). In this case (if you do not intend to retransmit the received data) you should ignore the unrecognized tags.



来源:https://stackoverflow.com/questions/31438256/asn-1-automatic-tags-and-extensibility-implied-attributes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!