NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
be_device_tlv.h
Go to the documentation of this file.
1/*
2 * This software was developed at the National Institute of Standards and
3 * Technology (NIST) by employees of the Federal Government in the course
4 * of their official duties. Pursuant to title 17 Section 105 of the
5 * United States Code, this software is not subject to copyright protection
6 * and is in the public domain. NIST assumes no responsibility whatsoever for
7 * its use by other parties, and makes no guarantees, expressed or implied,
8 * about its quality, reliability, or any other characteristic.
9 */
10
11#ifndef __BE_DEVICE_TLV_H__
12#define __BE_DEVICE_TLV_H__
13
14#include <memory>
15#include <string>
16#include <vector>
17
19
20namespace BiometricEvaluation
21{
22 namespace Device
23 {
34 class TLV {
35 public:
46 static std::string stringFromTLV(
47 const TLV &tlv,
48 const int tabCount);
49
57 TLV();
58
67
75
83 TLV(const std::string &filename);
84
98 void setTag(const Memory::uint8Array &tag);
99
105
111 uint32_t getTagNum() const;
112
118 uint8_t getTagClass() const;
119
125 bool isPrimitive() const;
126
137
146
154 void addChild(const TLV &tlv);
155
163 std::vector<TLV> getChildren() const;
164
177
178 private:
179 class Impl;
180 /*
181 * The PIMPL is a shared pointer so the implementation
182 * can access other TLV implementation object's state.
183 */
184 std::shared_ptr<TLV::Impl> pimpl;
185 };
186 }
187}
188#endif /* __BE_DEVICE_TLV_H__ */
189
A class to represent a Tag-Length-Value (TLV) data structure as described in the ISO 7816-4 integrate...
Definition: be_device_tlv.h:34
Memory::uint8Array getRawTLV() const
Obtain the TLV as an array of 8-bit values.
std::vector< TLV > getChildren() const
Get copies of the child TLVs.
void addChild(const TLV &tlv)
Add a child TLV.
bool isPrimitive() const
Obtain the type of TLV: primitive/constructed.
uint32_t getTagNum() const
Get the decoded tag number.
TLV()
Construct an empty Tag-Length-Value object that can be filled with setter methods.
uint8_t getTagClass() const
Get the decoded tag class.
TLV(const Memory::uint8Array &buf)
Construct a Tag-Length-Value object from the given buffer.
void setTag(const Memory::uint8Array &tag)
Set the encoded tag value.
void setPrimitive(const Memory::uint8Array &value)
Set the primitive data associated with this TLV.
TLV(const std::string &filename)
Construct a Tag-Length-Value object from the given file name.
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.
const Memory::uint8Array getTag() const
Obtain the encoded tag value.
TLV(Memory::IndexedBuffer &ibuf)
Construct a single TLV from the indexed buffer.
Memory::uint8Array getPrimitive() const
Obtain the primitive data associated with this TLV.
Wrap a memory buffer with an index.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...