what is the " CONTENT-TYPE" value if the mataInfo is 1 or 2?
Opened this issue · 1 comments
Pabears commented
CertificateContent = CONTENT-TYPE TLV-LENGTH SubjectPublicKeyInfo
- I don't know what the value of content-type should be if the contentType in metainfo is 1 or 2.
- If we use a TLV, why do we need the ContentType in the Metainfo? we can just let the content in Data is a TLV too, and the T is 0,1,2 or others.
thanks!
Pabears commented
- I think we could define a tow layers protocol,
first, the TLV-codec layer encodes TLV to binary or decodes TLV from binary
second, a TLV-explainer layer, explains a TLV with a TLV schema so that we can explain and validate a TLV tree.
for example:
we have a TLV-encoded binary: 0x06 0x08 0x08 0x00 0x08 0x04 0x08 0x02 0x08 0x08
we don't know how to explain the TLV, we could decode the binary to :- TLV{type=6, value=0x08 0x00 0x08 0x04 0x08 0x02 0x08 0x08 }
- TLV{type=6, value=TLV{type=8, value=}TLV{type=8, value=0x08 0x02 0x08 0x08 }}
- TLV{type=6, value=TLV{type=8, value=}TLV{type=8, value=TLV{type=8, value=0x08 0x08 }}}
so if we only have the TLV codec, we don't know what the mean binary is, we can define a TLV schema like:
(6(8*)),
so we can confirm the right decode is 2. We can share the schema with others, so everyone can explain the TLV.
If we are a NFD, we can just try to explain the first level of the TLV tree, so we can have good performance.