Closed Nicceboy closed 1 year ago
This change would make it easier to access bytes without added length or tags.
Thank you for your PR! Are you sure the length and tag should not be included other codecs? In the specs it's often cited as being a complete representation of the BER value, which would include tag and length.
The existing functions are still there which can be used to get the tag and length as well, if required. I do not know all the codecs. I noticed that in UPER you used the tag and length at least.
I compared to other implementations of OER and at least in this case they seems to drop. OER adds its own length determinant.
In OER standard section 21, it says that "contents octets of BER encoding of the object identifier value" (object identifier value specified in 8.19 ,BER standard), so I would assume that it is without length and tags.
In 8.19.5 section there is an example, which distincts contents
OBJECT IDENTIFIER | Length | Contents |
---|---|---|
0616 | 0316 | 88370316 |
Seems like that similar wording is also used in PER. Apparently the logic should be the same but which one it is 😄
I think this also applies for types GeneralizedTime
and UTCTime
. Should we split these functions in BER as well, or do helper functions outside of BER? Parsing the time strings would be identical.
Should we split these functions in BER as well, or do helper functions outside of BER? Parsing the time strings would be identical.
In BER so it's clear that it's the BER encoding being used.
Thank you for your PR!
Other codecs seems to re-use bytepresentation of BER encoding for ObjectIdentifier type.
This change would make it easier to access bytes without added length or tags.