jeudi 5 novembre 2020

How to extract tag, length and value from tlv bytes?

I have a task to do in C++ and I'm lost because I never used tlv bytes. I did some research but didn't really help me.

This is what I have to do :

Write a program in C ++ which takes as input a file composed of bytes in the form of TLV (Tag Length Value) and which prints on the standard output the various elements composing it with:

The tag and the length are 1 byte

The value being in the form TLV if the tag is 0

The value being a boolean if the tag is 1

The value being an integer if the tag is 2

The value being a character string if the tag is 3

The length being the length of the value

Can anyone help me please ?

Aucun commentaire:

Enregistrer un commentaire