Closed selfissued closed 8 years ago
There are two options that can be used here for encoding a protected header with no entries. It can be either a zero length binary string that is encoded, or it can be a zero length map that is encoded. There is no interopability issue as both of these are valid. The first is dealt with as a special case while the second just falls out from the normal case of there being any items in the map (i.e. the code to parse a map with 1 item or with 0 items is identical). This is a recommendation that one method ought to be used. This is the correct usage of a SHOULD.
The description of the “protected” field in Section 3 says “Senders SHOULD encode an empty protected map as a zero length binary object (it is shorter).” Such uses of “SHOULD” will result in interoperability problems. Therefore, please change the “SHOULD” to a “MUST”.