All those MIFARE cards management is quite huge to be implemented. I would suggest you to use existing open source libfreefare for such application: GitHub - nfc-tools/libfreefare: A convenience API for NFC cards manipulations on top of libnfc.
This libfreefare library runs on top of open source libnfc library. You can refer to the project I forked which includes support for the PN7120 via the Linux_libnfc-nci library: GitHub - jgeslin/libnfc: Platform independent Near Field Communication (NFC) library .
First of all the libnfc-nci must have been installed in the environment (sudo make install) and LD_LIBRARY_PATH environment must reflect the library installation patch (/usr/local/lib).
After cloning the jgeslin/libnfc repository run the following commands:
autoreconf -vis
./configure --prefix=/usr --sysconfdir=/etc --with-drivers=pn71xx
make
sudo make install
export LIBNFC_INTRUSIVE_SCAN=true
Pn7120 should be visible when running command:
nfc-scan-device -v
Then, after installing libfreefare, you shall be able to use related commands like:
mifare-desfire-format
mifare-classic-format
...