LibLogicalAccess  2.5.0
An Open Source RFID Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
logicalaccess::MifarePlusSL3Auth Class Reference

#include <MifarePlusSL3Auth.hpp>

Public Member Functions

 MifarePlusSL3Auth (std::shared_ptr< ReaderCardAdapter > rca)
 
bool firstAuthenticate (int sector, std::shared_ptr< AES128Key > key, MifareKeyType type)
 
ByteVector deriveKEnc ()
 
ByteVector deriveKMac ()
 
ByteVector computeWriteMac (uint8_t command_code, uint16_t block_number, const ByteVector &data)
 
ByteVector cipherWriteData (const ByteVector &in)
 

Public Attributes

ByteVector trans_id_
 
uint16_t write_counter_
 
uint16_t read_counter_
 

Private Member Functions

bool aes_first_auth_step2 ()
 
bool aes_first_auth_final (const ByteVector &encrypted_data)
 

Private Attributes

std::shared_ptr< ReaderCardAdapterrca_
 
ByteVector aes_key_
 
ByteVector rnd_a_
 
ByteVector rnd_b_
 

Detailed Description

Maintain the authentication state and key for MifarePlus in security level 3.

Constructor & Destructor Documentation

◆ MifarePlusSL3Auth()

MifarePlusSL3Auth::MifarePlusSL3Auth ( std::shared_ptr< ReaderCardAdapter rca)
explicit

Member Function Documentation

◆ aes_first_auth_final()

bool MifarePlusSL3Auth::aes_first_auth_final ( const ByteVector encrypted_data)
private

◆ aes_first_auth_step2()

bool MifarePlusSL3Auth::aes_first_auth_step2 ( )
private

◆ cipherWriteData()

ByteVector MifarePlusSL3Auth::cipherWriteData ( const ByteVector in)

◆ computeWriteMac()

ByteVector MifarePlusSL3Auth::computeWriteMac ( uint8_t  command_code,
uint16_t  block_number,
const ByteVector data 
)

◆ deriveKEnc()

ByteVector MifarePlusSL3Auth::deriveKEnc ( )

Derive KEnc for the session.

◆ deriveKMac()

ByteVector MifarePlusSL3Auth::deriveKMac ( )

Compute the key use for MACing.

◆ firstAuthenticate()

bool MifarePlusSL3Auth::firstAuthenticate ( int  sector,
std::shared_ptr< AES128Key key,
MifareKeyType  type 
)

Member Data Documentation

◆ aes_key_

ByteVector logicalaccess::MifarePlusSL3Auth::aes_key_
private

◆ rca_

std::shared_ptr<ReaderCardAdapter> logicalaccess::MifarePlusSL3Auth::rca_
private

◆ read_counter_

uint16_t logicalaccess::MifarePlusSL3Auth::read_counter_

◆ rnd_a_

ByteVector logicalaccess::MifarePlusSL3Auth::rnd_a_
private

◆ rnd_b_

ByteVector logicalaccess::MifarePlusSL3Auth::rnd_b_
private

◆ trans_id_

ByteVector logicalaccess::MifarePlusSL3Auth::trans_id_

◆ write_counter_

uint16_t logicalaccess::MifarePlusSL3Auth::write_counter_

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