LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
logicalaccess::JsonDumpCardService Class Referenceabstract

#include <json_dump_card_service.hpp>

Inheritance diagram for logicalaccess::JsonDumpCardService:
logicalaccess::CardService logicalaccess::DESFireJsonDumpCardService

Public Member Functions

virtual ~JsonDumpCardService ()
 
 JsonDumpCardService (const std::shared_ptr< Chip > &chip)
 
std::string getCSType () override
 
void configure (const std::string &json_template)
 
std::string dump ()
 
- Public Member Functions inherited from logicalaccess::CardService
virtual ~CardService ()=default
 
 CardService (std::shared_ptr< Chip > chip, CardServiceType serviceType)
 Constructor.
 
virtual std::string getCSType ()=0
 
std::shared_ptr< ChipgetChip () const
 
virtual CardServiceType getServiceType () const
 Get the card service type.
 

Public Attributes

std::map< std::string, std::shared_ptr< Format > > formats_
 
std::map< std::string, std::shared_ptr< Key > > keys_
 
std::map< std::string, std::shared_ptr< FormatInfos > > format_infos_
 

Static Public Attributes

static constexpr const CardServiceType service_type_ = CST_JSON_DUMP
 

Private Member Functions

void extract_formats (const nlohmann::json &json)
 
virtual std::shared_ptr< Keycreate_key (const nlohmann::json &key_description)=0
 
void extract_keys (const nlohmann::json &json)
 
virtual void configure_format_infos (const nlohmann::json &json)=0
 

Private Attributes

bool configured_
 

Additional Inherited Members

- Protected Attributes inherited from logicalaccess::CardService
std::shared_ptr< Chipd_chip
 Chip object.
 
CardServiceType d_serviceType
 Card service type.
 

Detailed Description

A high level service that read data from a card and return its content.

The content to fetch, from format to keys, is described by JSON. Similarly, the output is a JSON string representing the data that have been extracted from the card.

The input JSON format is RFID.onl format. Todo better documentation ?

Constructor & Destructor Documentation

◆ ~JsonDumpCardService()

logicalaccess::JsonDumpCardService::~JsonDumpCardService ( )
virtual

◆ JsonDumpCardService()

logicalaccess::JsonDumpCardService::JsonDumpCardService ( const std::shared_ptr< Chip > &  chip)
explicit

Member Function Documentation

◆ configure()

void logicalaccess::JsonDumpCardService::configure ( const std::string &  json_template)

Configure the service, providing the input JSON that will be used to create internal object required to properly dump the content of the card.

It is required to call configure() before calling dump().

◆ configure_format_infos()

virtual void logicalaccess::JsonDumpCardService::configure_format_infos ( const nlohmann::json &  json)
privatepure virtual

Populate the format_infos_ map. The subclass is expected to parse the provided JSON and create corresponding FormatInfo with proper Format, Location and AccessInfo.

Implemented in logicalaccess::DESFireJsonDumpCardService.

◆ create_key()

virtual std::shared_ptr< Key > logicalaccess::JsonDumpCardService::create_key ( const nlohmann::json &  key_description)
privatepure virtual

Create a properly typed key object that can be used against the given card.

Implemented in logicalaccess::DESFireJsonDumpCardService.

◆ dump()

std::string logicalaccess::JsonDumpCardService::dump ( )

Dump the content of the content of the card, according the configuration provided at the configure() call.

◆ extract_formats()

void logicalaccess::JsonDumpCardService::extract_formats ( const nlohmann::json &  json)
private

◆ extract_keys()

void logicalaccess::JsonDumpCardService::extract_keys ( const nlohmann::json &  json)
private

◆ getCSType()

std::string logicalaccess::JsonDumpCardService::getCSType ( )
inlineoverridevirtual

Member Data Documentation

◆ configured_

bool logicalaccess::JsonDumpCardService::configured_
private

◆ format_infos_

std::map<std::string, std::shared_ptr<FormatInfos> > logicalaccess::JsonDumpCardService::format_infos_

◆ formats_

std::map<std::string, std::shared_ptr<Format> > logicalaccess::JsonDumpCardService::formats_

◆ keys_

std::map<std::string, std::shared_ptr<Key> > logicalaccess::JsonDumpCardService::keys_

◆ service_type_

constexpr const CardServiceType logicalaccess::JsonDumpCardService::service_type_ = CST_JSON_DUMP
staticconstexpr

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