NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
|
A class to represent a Tag-Length-Value (TLV) data structure as described in the ISO 7816-4 integrated circuit card standard. More...
#include <be_device_tlv.h>
Public Member Functions | |
TLV () | |
Construct an empty Tag-Length-Value object that can be filled with setter methods. More... | |
TLV (const Memory::uint8Array &buf) | |
Construct a Tag-Length-Value object from the given buffer. More... | |
TLV (Memory::IndexedBuffer &ibuf) | |
Construct a single TLV from the indexed buffer. More... | |
TLV (const std::string &filename) | |
Construct a Tag-Length-Value object from the given file name. More... | |
void | setTag (const Memory::uint8Array &tag) |
Set the encoded tag value. More... | |
const Memory::uint8Array | getTag () const |
Obtain the encoded tag value. More... | |
uint32_t | getTagNum () const |
Get the decoded tag number. More... | |
uint8_t | getTagClass () const |
Get the decoded tag class. More... | |
bool | isPrimitive () const |
Obtain the type of TLV: primitive/constructed. More... | |
void | setPrimitive (const Memory::uint8Array &value) |
Set the primitive data associated with this TLV. More... | |
Memory::uint8Array | getPrimitive () const |
Obtain the primitive data associated with this TLV. More... | |
void | addChild (const TLV &tlv) |
Add a child TLV. More... | |
std::vector< TLV > | getChildren () const |
Get copies of the child TLVs. More... | |
Memory::uint8Array | getRawTLV () const |
Obtain the TLV as an array of 8-bit values. More... | |
Static Public Member Functions | |
static std::string | stringFromTLV (const TLV &tlv, const int tabCount) |
Class utility function to print the contents of a TLV into a string object, in readable format. More... | |
A class to represent a Tag-Length-Value (TLV) data structure as described in the ISO 7816-4 integrated circuit card standard.
A TLV is composed of tag and length fields, then a value field that may be another TLV (a child), or data of another format, represented as the primitive object in this class.
Definition at line 34 of file be_device_tlv.h.
BiometricEvaluation::Device::TLV::TLV | ( | ) |
Construct an empty Tag-Length-Value object that can be filled with setter methods.
Empty TLV objects are primitive.
BiometricEvaluation::Device::TLV::TLV | ( | const Memory::uint8Array & | buf | ) |
Construct a Tag-Length-Value object from the given buffer.
Error::DataError | The data in the buffer is not conforming. |
BiometricEvaluation::Device::TLV::TLV | ( | Memory::IndexedBuffer & | ibuf | ) |
Construct a single TLV from the indexed buffer.
Error::DataError | Error parsing the data in the buffer. |
BiometricEvaluation::Device::TLV::TLV | ( | const std::string & | filename | ) |
Construct a Tag-Length-Value object from the given file name.
Error::DataError | The data in the file is not conformance. |
|
static |
void BiometricEvaluation::Device::TLV::setTag | ( | const Memory::uint8Array & | tag | ) |
Set the encoded tag value.
This function will cause a recalculation of the decoded tag number, class and primitive indicators.
Error::DataError | The primitive indicator conflicts with the presence of children TLVs, or presence of primitive data. |
Error::ParameterError | The length of the buffer is larger than the maximum tag length. |
const Memory::uint8Array BiometricEvaluation::Device::TLV::getTag | ( | ) | const |
Obtain the encoded tag value.
uint32_t BiometricEvaluation::Device::TLV::getTagNum | ( | ) | const |
Get the decoded tag number.
uint8_t BiometricEvaluation::Device::TLV::getTagClass | ( | ) | const |
Get the decoded tag class.
bool BiometricEvaluation::Device::TLV::isPrimitive | ( | ) | const |
void BiometricEvaluation::Device::TLV::setPrimitive | ( | const Memory::uint8Array & | value | ) |
Set the primitive data associated with this TLV.
The primitive data is added as the value data item.
Error::DataError | The TLV is already of the constructed form, meaning that there are TLV children set as the value data. |
Memory::uint8Array BiometricEvaluation::Device::TLV::getPrimitive | ( | ) | const |
Obtain the primitive data associated with this TLV.
Error::DataError | The TLV is of the constructed form. |
void BiometricEvaluation::Device::TLV::addChild | ( | const TLV & | tlv | ) |
Add a child TLV.
Error::DataError | The TLV is primitive. |
std::vector< TLV > BiometricEvaluation::Device::TLV::getChildren | ( | ) | const |
Get copies of the child TLVs.
Error::DataError | The TLV is primitive. |
Memory::uint8Array BiometricEvaluation::Device::TLV::getRawTLV | ( | ) | const |