MifareCard Class

Definition

A Mifare card class Supports Mifare Classic 1K and 4K Also supports Mifare Plus 2K and 4K operating in SL1

public class MifareCard
type MifareCard = class
Public Class MifareCard
Inheritance
MifareCard

Constructors

MifareCard(CardTransceiver, Byte)

Constructor for Mifarecard

Properties

BlockNumber

The block number to authenticate or read or write

Capacity

The storage capacity

Command

The command to execute on the card

Data

The Data which has been read or to write for the specific block

DefaultBlocksNdefKeyA

Default block Key A for NDEF card

DefaultFirstBlockNdefKeyA

Default Mifare Application Directory block Key A for NDEF card The MAD is in the first sector on all cards and also sector 16 on 2K and 4K cards

DefaultKeyA

Default Key A

DefaultKeyB

Default Key B

KeyA

Key A Used for encryption/decryption

KeyB

Key B Used for encryption/decryption

ReselectAfterError

Reselect the card after a card command fails After an error, the card will not respond to any further commands until it is reselected. If this property is false, the caller is responsible for calling ReselectCard when RunMifareCardCommand returns an error (-1).

SerialNumber

UUID is the Serial Number, called MAC sometimes

Target

The tag number detected by the reader, only 1 or 2

Methods

BlockAccess(Byte, Byte[])

Get the block access information

BlockNumberToBlockGroup(Byte)

Determine the block group corresponding to a block number

BlockNumberToSector(Byte)

Determine the sector number corresponding to a particular block number

EncodeDefaultSectorAndBlockTailer()

Encode with default value the access sector and tailer blocks

EncodeSectorAndBlockTailer(AccessSector, AccessType[])

Encode the desired access for the full sector including the block tailer

EncodeSectorAndClockTailer(AccessSector, AccessType[])
Obsolete.

Encode the desired access for the full sector including the block tailer

EncodeSectorTailer(AccessSector)

Get the sector tailer bytes for a specific access sector configuration

EncodeSectorTailer(Byte, AccessType)

Encode the sector tailer access type for a specific block

EraseSector(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Byte, Boolean, Boolean)

Erase one sector

FormatNdef(ReadOnlySpan<Byte>)

Format the entire card to NDEF

FormatNdef(UInt32, ReadOnlySpan<Byte>)

Format a portion of the card to NDEF

GetNumberBlocks()

Get the number of blocks for a specific sector

GetNumberBlocks(Byte)

Get the number of blocks for a specific sector

GetNumberSectors()

Get the number of sectors

IsFormattedNdef()

Check if the card is formatted to NDEF

IsSectorBlock(Byte)

Is it a block sector?

ReselectCard()

Select the card. Needed if authentication or read/write failed

RunMifareCardCommand()

Run the last setup command. In case of reading bytes, they are automatically pushed into the Data property

RunMifiCardCommand()

Run the last setup command. In case of reading bytes, they are automatically pushed into the Data property

SectorTailerAccess(Byte, Byte[])

Get the sector tailer access information

SectorToBlockNumber(Byte, Byte)

Determine the first block number of a specified sector and block group

SetCapacity(UInt16, Byte)

From the ATQA and SAK data find common card capacity

TryReadNdefMessage(NdefMessage)

Try to read a NDEF Message from a Mifare card

WriteDataBlock(Byte)

Perform a write using the 16 bytes present in Data on a specific block

WriteNdefMessage(NdefMessage, Boolean)

Write an NDEF Message

Applies to