Edit

Share via


MifareDirectory Class

Definition

Mifare application directory This describes the assignent of sectors on the MifareCard to applications. The on-card directory is described in https://www.nxp.com/docs/en/application-note/AN10787.pdf

public class MifareDirectory
type MifareDirectory = class
Public Class MifareDirectory
Inheritance
MifareDirectory

Properties

CardPublisherSector

Card publisher sector (if any) If non-zero, this indicates the sector that is allocated to the card publisher.

Methods

Allocate(MifareApplicationIdentifier, UInt32)

Allocate sectors in the directory for a specified application This only updates the directory, not the application's data blocks or sector trailers. The directory must be written back to the card with StoreToCard(ReadOnlySpan<Byte>). Specifying an allocation of 0 sectors will cause the largest available contiguous set of sectors to be allocated to this application. If the directory is empty, this allocates everything.

CalculateCrc(ReadOnlySpan<Byte>)

Calculate the CRC byte for a Mifare application directory segment

CreateEmpty(MifareCard)

Create an empty MifareDirectory for a specified MifareCard

Free(MifareDirectoryEntry, Boolean)

Free the sectors associated with the specified directory entry This only updates the directory, not the data blocks or sector trailers. The directory must be written back to the card with StoreToCard(ReadOnlySpan<Byte>). If the sectors cannot be reused for some reason, such as if the authentication key has been lost or the sector trailer is read-only, then the sectors should be freed as "defective" so that they will not be available for reallocation.

GetApplications(Func<MifareApplicationIdentifier,Boolean>)

Get directory entries for all applications matching a particular filter criterion

LoadFromCard(MifareCard)

Load the MifareDirectory from a specified MifareCard The directory blocks must have the correct Akey and access bytes. The directory CRC must be valid.

StoreToCard(ReadOnlySpan<Byte>)

Store the MifareDirectory to its MifareCard

TryGetApplication(MifareApplicationIdentifier)

Try to get a directory entry for a particular application ID

Applies to