[英]Desfire Transaction File Creation Parameter Error
在創建事務 mac 文件期間,在 Mifare Desfire Ev2 卡上,我收到錯誤消息。 “com.nxp.nfclib.exceptions.PICCException:參數錯誤 SW2 = -98” 我正在使用 Taplinx 庫,具有以下事務文件設置:
public static final byte[] KEY_AES128_00_DEFAULT =
{
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
};
DESFireFile.Ev2TransactionMacFileSettings fileSettings = new DESFireFile.Ev2TransactionMacFileSettings(
IDESFireEV2.CommunicationType.Plain, //comSettings
(byte) 0x00, //readAccess
(byte) 0x0f, //writeAccess
(byte) 0x00, //readWriteAccess
(byte) 0x00, //changeAccess
(byte) 0x00, //tmKeyOption
KEY_AES128_00_DEFAULT, //tmKey
(byte) 0x00); //tmKeyVersion
根據文檔,我認為這應該是正確的: https ://www.mifare.net/developer/javadoc/android/ 但我仍然收到錯誤消息。 如果有人知道什么,請告訴我。 謝謝 <3
經過3天的努力,這是我得到的解決方案:
DESFireFile.Ev2TransactionMacFileSettings fileSettings = new DESFireFile.Ev2TransactionMacFileSettings(
IDESFireEV1.CommunicationType.Plain, //comSettings
(byte) 0x0, //readAccess
(byte) 0xF, //writeAccess
(byte) 0xF, //readWriteAccess
(byte) 0x0, //changeAccess
(byte) 0x2, //tmKeyOption
KEY_AES128_00_DEFAULT, //tmKey
(byte) 0x0); //tmKeyVersion
desfire.createFile(0x00, fileSettings);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.