/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.nfc.tech; import android.nfc.ErrorCodes; import android.nfc.Tag; import android.nfc.TagLostException; import android.os.RemoteException; import android.util.Log; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * Provides access to MIFARE Classic properties and I/O operations on a {@link Tag}. * *

Acquire a {@link MifareClassic} object using {@link #get}. * *

MIFARE Classic is also known as MIFARE Standard. *

MIFARE Classic tags are divided into sectors, and each sector is sub-divided into * blocks. Block size is always 16 bytes ({@link #BLOCK_SIZE}. Sector size varies. *

* *

MIFARE Classic tags require authentication on a per-sector basis before any * other I/O operations on that sector can be performed. There are two keys per sector, * and ACL bits determine what I/O operations are allowed on that sector after * authenticating with a key. {@see #authenticateSectorWithKeyA} and * {@see #authenticateSectorWithKeyB}. * *

Three well-known authentication keys are defined in this class: * {@link #KEY_DEFAULT}, {@link #KEY_MIFARE_APPLICATION_DIRECTORY}, * {@link #KEY_NFC_FORUM}. *