7#ifndef LOGICALACCESS_MIFAREKEY_HPP
8#define LOGICALACCESS_MIFAREKEY_HPP
11#include <logicalaccess/plugins/cards/mifare/lla_cards_mifare_api.hpp>
16#define MIFARE_KEY_SIZE 6
26 using XmlSerializable::serialize;
27 using XmlSerializable::unSerialize;
38 explicit MifareKey(
const std::string &str);
45 MifareKey(
const void *buf,
size_t buflen);
50 void clear()
override;
65 const unsigned char *
getData()
const override
83 void serialize(boost::property_tree::ptree &parentNode)
override;
89 void unSerialize(boost::property_tree::ptree &node)
override;
95 std::string getDefaultXmlNodeName()
const override;
99 unsigned char *keyA = this->getData();
100 unsigned char *keyB = b.
getData();
102 for (
unsigned int i = 0; i != 6; i++)
104 if (keyA[i] != keyB[i])
112 bool a = (*this) == b;
A Key base class. The key object is used to describe key chip information used for authentication on ...
Definition: key.hpp:22
A Mifare Key class.
Definition: mifarekey.hpp:24
size_t getLength() const override
Get the key length.
Definition: mifarekey.hpp:56
bool operator==(MifareKey b)
Definition: mifarekey.hpp:97
const unsigned char * getData() const override
Get the key data.
Definition: mifarekey.hpp:65
bool operator!=(MifareKey b)
Definition: mifarekey.hpp:110
unsigned char * getData() override
Get the key data.
Definition: mifarekey.hpp:74
#define MIFARE_KEY_SIZE
The default Mifare key size.
Definition: mifarekey.hpp:16