LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
logicalaccess::MifareAccessInfo Class Reference

A Mifare access informations. More...

#include <mifareaccessinfo.hpp>

Inheritance diagram for logicalaccess::MifareAccessInfo:
logicalaccess::AccessInfo logicalaccess::XmlSerializable logicalaccess::MifarePlusSL1AccessInfo

Classes

struct  BlockAccessBits
 Block access bits structure. More...
 
struct  DataBlockAccessBits
 Data block access bits structure. More...
 
struct  SectorAccessBits
 Sector access bits structure. More...
 
struct  SectorTrailerAccessBits
 Sector trailer block access bits structure. More...
 

Public Member Functions

 MifareAccessInfo ()
 Constructor.
 
virtual ~MifareAccessInfo ()
 Destructor.
 
void generateInfos () override
 Generate pseudo-random Mifare access informations.
 
std::string getCardType () const override
 Get the card type for this access infos.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &parentNode) override
 UnSerialize a XML node to the current object.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
bool operator== (const AccessInfo &ai) const override
 Equality operator.
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
virtual void unSerialize (boost::property_tree::ptree &node)=0
 UnSerialize object from a Xml Node.
 
virtual void unSerialize (const std::string &xmlstring, const std::string &rootNode)
 UnSerialize object from a Xml Node string.
 
virtual void unSerialize (std::istream &is, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerialize (boost::property_tree::ptree &node, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
- Public Member Functions inherited from logicalaccess::AccessInfo
 AccessInfo ()
 Constructor.
 
virtual ~AccessInfo ()=default
 
virtual void generateInfos ()=0
 Generate pseudo-random access informations.
 
virtual std::string getCardType () const =0
 Get the card type for this access infos.
 
virtual bool operator== (const AccessInfo &ai) const
 Equality operator.
 
bool operator!= (const AccessInfo &ai) const
 Inequality operator.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
virtual ~XmlSerializable ()=default
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual std::string serializeWithHeaders ()
 Serialize object to Xml Node string, with xml headers.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
virtual void serializeToFile (const std::string &filename)
 Serialize object to a Xml file.
 
virtual void unSerialize (boost::property_tree::ptree &node)=0
 UnSerialize object from a Xml Node.
 
virtual void unSerialize (const std::string &xmlstring, const std::string &rootNode)
 UnSerialize object from a Xml Node string.
 
virtual void unSerialize (std::istream &is, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerialize (boost::property_tree::ptree &node, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerializeFromFile (const std::string &filename)
 UnSerialize object from a Xml file.
 
virtual std::string getDefaultXmlNodeName () const =0
 Get the default Xml Node name for this object.
 

Public Attributes

std::shared_ptr< MifareKeykeyA
 The key A.
 
std::shared_ptr< MifareKeykeyB
 The key B.
 
bool useMAD
 MAD is used ?
 
std::shared_ptr< MifareKeymadKeyA
 The MAD A Key.
 
std::shared_ptr< MifareKeymadKeyB
 The MAD B Key.
 
SectorAccessBits sab
 The sector access bits.
 
unsigned char gpb
 The sector GPB.
 
unsigned char madGPB
 The MAD GPB.
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::AccessInfo
static std::string generateSimpleKey (size_t keySize)
 Generate a key data.
 
static std::string generateSimpleDESKey (size_t keySize)
 Generate a DES key data.
 
- Static Public Member Functions inherited from logicalaccess::XmlSerializable
static std::string removeXmlDeclaration (const std::string &xmlstring)
 Remove Xml declaration from a xml string.
 
static ByteVector formatHexString (std::string hexstr)
 Format hex string to hex string with space.
 
- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A Mifare access informations.

Constructor & Destructor Documentation

◆ MifareAccessInfo()

logicalaccess::MifareAccessInfo::MifareAccessInfo ( )

Constructor.

◆ ~MifareAccessInfo()

logicalaccess::MifareAccessInfo::~MifareAccessInfo ( )
virtual

Destructor.

Member Function Documentation

◆ generateInfos()

void logicalaccess::MifareAccessInfo::generateInfos ( )
overridevirtual

Generate pseudo-random Mifare access informations.

Implements logicalaccess::AccessInfo.

◆ getCardType()

std::string logicalaccess::MifareAccessInfo::getCardType ( ) const
overridevirtual

Get the card type for this access infos.

Returns
The card type.

Implements logicalaccess::AccessInfo.

Reimplemented in logicalaccess::MifarePlusSL1AccessInfo.

◆ getDefaultXmlNodeName()

std::string logicalaccess::MifareAccessInfo::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

Reimplemented in logicalaccess::MifarePlusSL1AccessInfo.

◆ operator==()

bool logicalaccess::MifareAccessInfo::operator== ( const AccessInfo ai) const
overridevirtual

Equality operator.

Parameters
aiAccess infos to compare.
Returns
True if equals, false otherwise.

Reimplemented from logicalaccess::AccessInfo.

◆ serialize() [1/3]

std::string logicalaccess::XmlSerializable::serialize ( )
virtual

Serialize object to Xml Node string.

Returns
The serialized object.

Reimplemented from logicalaccess::XmlSerializable.

◆ serialize() [2/3]

void logicalaccess::MifareAccessInfo::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Implements logicalaccess::XmlSerializable.

Reimplemented in logicalaccess::MifarePlusSL1AccessInfo.

◆ serialize() [3/3]

virtual void logicalaccess::XmlSerializable::serialize ( boost::property_tree::ptree &  parentNode)
virtual

Serialize object to Xml Node.

Parameters
osThe XML stream.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [1/5]

virtual void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node)
virtual

UnSerialize object from a Xml Node.

Parameters
nodeThe Xml node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [2/5]

void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
nodeThe Xml node.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [3/5]

void logicalaccess::MifareAccessInfo::unSerialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Implements logicalaccess::XmlSerializable.

Reimplemented in logicalaccess::MifarePlusSL1AccessInfo.

◆ unSerialize() [4/5]

void logicalaccess::XmlSerializable::unSerialize ( const std::string &  xmlstring,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml Node string.

Parameters
xmlstringThe Xml Node string.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [5/5]

void logicalaccess::XmlSerializable::unSerialize ( std::istream &  is,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
isThe Xml stream.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

Member Data Documentation

◆ gpb

unsigned char logicalaccess::MifareAccessInfo::gpb

The sector GPB.

◆ keyA

std::shared_ptr<MifareKey> logicalaccess::MifareAccessInfo::keyA

The key A.

◆ keyB

std::shared_ptr<MifareKey> logicalaccess::MifareAccessInfo::keyB

The key B.

◆ madGPB

unsigned char logicalaccess::MifareAccessInfo::madGPB

The MAD GPB.

◆ madKeyA

std::shared_ptr<MifareKey> logicalaccess::MifareAccessInfo::madKeyA

The MAD A Key.

◆ madKeyB

std::shared_ptr<MifareKey> logicalaccess::MifareAccessInfo::madKeyB

The MAD B Key.

◆ sab

SectorAccessBits logicalaccess::MifareAccessInfo::sab

The sector access bits.

◆ useMAD

bool logicalaccess::MifareAccessInfo::useMAD

MAD is used ?


The documentation for this class was generated from the following files: