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

#include <epasscommands.hpp>

Inheritance diagram for logicalaccess::EPassCommands:
logicalaccess::Commands logicalaccess::ICommands logicalaccess::EPassISO7816Commands

Public Member Functions

 EPassCommands ()
 
 EPassCommands (std::string ct)
 
void setReaderCardAdapter (std::shared_ptr< ReaderCardAdapter > adapter) override
 Set the reader/card adapter.
 
bool selectApplication (const ByteVector &app_id)
 
bool selectIssuerApplication ()
 
bool authenticate (const std::string &mrz)
 
EPassEFCOM readEFCOM () const
 
ByteVector readEF (uint8_t size_bytes, uint8_t size_offset) const
 
EPassDG1 readDG1 () const
 
EPassDG2 readDG2 ()
 
ByteVector readSOD () const
 
virtual std::shared_ptr< ISO7816CommandsgetISO7816Commands () const =0
 
- Public Member Functions inherited from logicalaccess::Commands
 Commands ()=delete
 Constructor.
 
virtual ~Commands ()
 
std::shared_ptr< ChipgetChip () const override
 Get the chip.
 
virtual void setChip (std::shared_ptr< Chip > chip)
 Set the chip.
 
std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () const override
 Get the reader/card adapter.
 
virtual void setReaderCardAdapter (std::shared_ptr< ReaderCardAdapter > adapter)
 Set the reader/card adapter.
 
virtual const std::string & getCmdType () const
 Get the cmd name.
 
virtual void setCmdType (const std::string &command_type)
 Set the cmd name.
 
- Public Member Functions inherited from logicalaccess::ICommands
virtual ~ICommands ()=default
 
virtual std::shared_ptr< ChipgetChip () const =0
 Get the chip.
 
virtual std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () const =0
 Get the reader/card adapter.
 

Private Member Functions

ByteVector compute_hash (const ByteVector &file_id) const
 

Private Attributes

ByteVector current_app_
 
std::shared_ptr< EPassCryptocrypto_
 

Additional Inherited Members

- Protected Member Functions inherited from logicalaccess::Commands
 Commands (std::string commandtype)
 Constructor.
 
- Protected Attributes inherited from logicalaccess::Commands
std::shared_ptr< ReaderCardAdapterd_readerCardAdapter
 The reader/card adapter.
 
std::weak_ptr< Chipd_chip
 The chip.
 
std::string d_commandtype
 The command type.
 

Constructor & Destructor Documentation

◆ EPassCommands() [1/2]

EPassCommands::EPassCommands ( )

◆ EPassCommands() [2/2]

EPassCommands::EPassCommands ( std::string  ct)
explicit

Member Function Documentation

◆ authenticate()

bool EPassCommands::authenticate ( const std::string &  mrz)

◆ compute_hash()

ByteVector EPassCommands::compute_hash ( const ByteVector file_id) const
private

◆ getISO7816Commands()

virtual std::shared_ptr< ISO7816Commands > logicalaccess::EPassCommands::getISO7816Commands ( ) const
pure virtual

◆ readDG1()

EPassDG1 EPassCommands::readDG1 ( ) const

Extract information from Data Group 1.

Note
Data Group 1 contains the various data available on the MRZ.

◆ readDG2()

EPassDG2 EPassCommands::readDG2 ( )

Retrieve the content of the Data Group 2 and present it throughout a usable object.

Note
Data Group 2 contains facial biometric.

◆ readEF()

ByteVector EPassCommands::readEF ( uint8_t  size_bytes,
uint8_t  size_offset 
) const

Fully read the current file.

Parameters
size_bytesIs the number of bytes used to encode the size of the file, it will generally be 0 or 1.
size_offsetThe offset at which the bytes representing the data size starts, this is generally 1-3, depending on the tag length.

◆ readEFCOM()

EPassEFCOM EPassCommands::readEFCOM ( ) const

Retrieve the content of the EF.COM file.

This is a necessary step because it enumerates the others files present on the chip.

◆ readSOD()

ByteVector EPassCommands::readSOD ( ) const

Read the content of SOD, the area that contains hash value for the rest of the EPassport. It allows for verifying the integrity of the chip's content.

◆ selectApplication()

bool EPassCommands::selectApplication ( const ByteVector app_id)

◆ selectIssuerApplication()

bool EPassCommands::selectIssuerApplication ( )

◆ setReaderCardAdapter()

void EPassCommands::setReaderCardAdapter ( std::shared_ptr< ReaderCardAdapter adapter)
overridevirtual

Set the reader/card adapter.

Parameters
adapterThe reader/card adapter.

Reimplemented from logicalaccess::Commands.

Member Data Documentation

◆ crypto_

std::shared_ptr<EPassCrypto> logicalaccess::EPassCommands::crypto_
private

◆ current_app_

ByteVector logicalaccess::EPassCommands::current_app_
private

The identifier of the currently selected application.

This is a part of a hack. We ignore selectApplication if the we already have selected the one we want. Somehow, on some passport, this cause a failure.


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