Bagikan melalui


MifareClassic.AuthenticateSectorWithKeyB(Int32, Byte[]) Method

Definition

Authenticate a sector with key B.

[Android.Runtime.Register("authenticateSectorWithKeyB", "(I[B)Z", "")]
public bool AuthenticateSectorWithKeyB (int sectorIndex, byte[]? key);
[<Android.Runtime.Register("authenticateSectorWithKeyB", "(I[B)Z", "")>]
member this.AuthenticateSectorWithKeyB : int * byte[] -> bool

Parameters

sectorIndex
Int32

index of sector to authenticate, starting from 0

key
Byte[]

6-byte authentication key

Returns

true on success, false on authentication failure

Attributes

Exceptions

if the tag leaves the field

if there is an I/O failure, or the operation is canceled

Remarks

Authenticate a sector with key B.

Successful authentication of a sector with key B enables other I/O operations on that sector. The set of operations granted by key B depends on the ACL bits set in that sector. For more information see the MIFARE Classic specification on http://www.nxp.com.

A failed authentication attempt causes an implicit reconnection to the tag, so authentication to other sectors will be lost.

This is an I/O operation and will block until complete. It must not be called from the main application thread. A blocked call will be canceled with IOException if #close is called from another thread.

<p class="note">Requires the android.Manifest.permission#NFC permission.

Java documentation for android.nfc.tech.MifareClassic.authenticateSectorWithKeyB(int, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to