---
name: "mifare_desfire_aid_new_with_mad_aid"
section: "3"
platform: "linux"
package: "libfreefare-doc"
version: "0.4.0-2.3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mifare_desfire_aid"
---

# mifare\_desfire\_aid\_new\_with\_mad\_aid(3)

Mifare DESFire AID Manipulation Functions

Part of [mifare\_desfire\_aid(3)](/mifare_desfire_aid/3.md).

## NAME

**mifare\_desfire\_aid\_new**, **mifare\_desfire\_aid\_new\_with\_mad\_aid**, **mifare\_desfire\_aid\_get\_aid** – Mifare DESFire AID Manipulation Functions

## LIBRARY

Mifare card manipulation library (libfreefare, -lfreefare)

## SYNOPSIS

**#include \<freefare.h\>**

*MifareDESFireAID*\

**mifare\_desfire\_aid\_new**(*uint32\_t aid*);

*MifareDESFireAID*\

**mifare\_desfire\_aid\_new\_with\_mad\_aid**(*MadAid mad\_aid*, *uint8\_t n*);

*uint32\_t*\

**mifare\_desfire\_aid\_get\_aid**(*MifareDESFireAID aid*);

## DESCRIPTION

The **mifare\_desfire\_aid\_\***() functions allows management of Mifare DESFire AIDs. The **mifare\_desfire\_aid\_new**() function returns a new Mifare DESFire AID of value *aid*.

The **mifare\_desfire\_aid\_new\_with\_mad\_aid**() functions returns a new Mifare DESFire AID using a Mifare Classic AID *mad\_aid* and  *n* as the last nibble of the new AID.

Both **mifare\_desfire\_aid\_new**() and **mifare\_desfire\_aid\_new\_with\_mad\_aid**() allocates memory that should be reclaimed using [free(3)](/free/3.md).

The **mifare\_desfire\_aid\_get\_aid**() function returns the *aid* of the provided Mifare DESFire AID.

## RETURN VALUES

The allocation functions returns the allocated AID on success, *NULL* otherwise.

## SEE ALSO

[freefare(3)](/freefare/3.md), [mifare\_classic(3)](/mifare_classic/3.md), [free(3)](/free/3.md)

## AUTHORS

Romain Tartiere ⟨romain@il4p.org⟩
