10using System.Globalization;
45 if (Interface2 == Interface)
57 if (!
string.IsNullOrEmpty(Mrz) &&
62 byte[]? Challenge = await IsoDep.GetChallenge();
63 if (Challenge is not
null && DocInfo is not
null)
65 byte[] ChallengeResponse = DocInfo.CalcChallengeResponse(Challenge);
66 byte[]? Response = await IsoDep.ExternalAuthenticate(ChallengeResponse);
74 bool CanMakeReadOnly = await Ndef.CanMakeReadOnly();
75 bool IsWritable = await Ndef.IsWritable();
78 if (Records.Length == 0 && IsWritable)
80 await
ProgramNfc(Items => Ndef.SetMessage(Items));
105 await
ProgramNfc(Items => NdefFormatable.Format(
false, Items));
110 byte[] Atqa = await NfcA.GetAtqa();
111 short Sqk = await NfcA.GetSqk();
117 byte[] ApplicationData = await NfcB.GetApplicationData();
118 byte[] ProtocolInfo = await NfcB.GetProtocolInfo();
124 byte[] Manufacturer = await NfcF.GetManufacturer();
125 byte[] SystemCode = await NfcF.GetSystemCode();
131 sbyte DsfId = await NfcV.GetDsfId();
132 short ResponseFlags = await NfcV.GetResponseFlags();
138 byte[] Data = await Barcode.ReadAllData();
144 byte[] Data = await MifareUltralight.ReadAllData();
150 byte[] Data = await MifareClassic.ReadAllData();
162 public delegate Task<bool> WriteItems(
object[] Items);
169 public static async Task<bool>
ProgramNfc(WriteItems Callback)
176 string? Link = LinkableView.Link;
177 string Title = await LinkableView.Title;
179 List<object> Items = [];
181 if (LinkableView.EncodeAppLinks)
184 if (!
string.IsNullOrEmpty(Link))
185 Items.Add(
new Uri(Link));
187 if (LinkableView.EncodeAppLinks)
193 if (LinkableView.HasMedia)
194 Items.Add(
new KeyValuePair<
byte[],
string>(LinkableView.Media!, LinkableView.MediaContentType!));
199 bool Ok = await Callback([.. Items]);
201 if (!Ok && Items[^1] is KeyValuePair<
byte[],
string>)
203 Items.RemoveAt(Items.Count - 1);
204 Ok = await Callback([.. Items]);
209 while (Items.Count > 2)
212 Ok = await Callback([.. Items]);
217 Ok = await Callback([.. Items]);
Contains NFC Extensions for Basic Access Control.
static bool ParseMrz(string MRZ, out DocumentInformation? Info)
Derives Basic Access Control Keys from the second row of the Machine-Readable string in passport (MRZ...
The Application class, representing an instance of the Neuro-Access app.
static Task< bool > AuthenticateUser(AuthenticationPurpose Purpose, bool Force=false)
Authenticates the user using the configured authentication method.
static Task< bool > OpenUrlAsync(string Url)
Opens an URL in the application.
References to external resources
const string IPhoneApp
Resource where iPhone App can be downloaded.
const string AndroidApp
Resource where Android App can be downloaded.
static ? string GetScheme(string Url)
Gets the predefined scheme from an IoT Code
A set of never changing property constants and helpful values.
Near-Field Communication (NFC) Service.
NfcService()
Near-Field Communication (NFC) Service.
static async Task< bool > ProgramNfc(WriteItems Callback)
Programs an NFC tag.
async Task TagDetected(INfcTag Tag)
Method called when a new NFC Tag has been detected.
Contains information about a contact.
static Task< NfcTagReference > FindByTagId(CaseInsensitiveString TagId)
Finds information about a contact, given its Bare JID.
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static IStringLocalizer Localizer
Localization service
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Static class managing persistent settings.
static async Task< string > GetAsync(string Key, string DefaultValue)
Gets a string-valued setting.
Contains methods for simple hash calculations.
static string BinaryToString(byte[] Data)
Converts an array of bytes to a string with their hexadecimal representations (in lower case).
ISO DEP interface, for communication with an NFC Tag.
Mifare Classic interface, for communication with an NFC Tag.
Mifare Ultralight interface, for communication with an NFC Tag.
NDEF interface, for communication with an NFC Tag.
NFC A interface, for communication with an NFC Tag.
NFC B interface, for communication with an NFC Tag.
NFC Barcode interface, for communication with an NFC Tag.
NFC F interface, for communication with an NFC Tag.
Specific Interface (technology) for communication with an NFC Tag.
void CloseIfOpen()
Closes the interface, if connected.
Task OpenIfClosed()
Connects the interface, if not connected.
Interface for an NFC Tag.
INfcInterface[] Interfaces
Communication interfaces available on the NFC Tag.
NFC V interface, for communication with an NFC Tag.
Interface for NDEF records
Interface for NDEF URI records
Interface for the Near-Field Communication (NFC) Service.
Service serializing and managing UI-related tasks.
Page CurrentPage
Current page
Task DisplayException(Exception Exception, string? Title=null)
Displays an alert/message box to the user.
Task< bool > DisplayAlert(string Title, string Message, string? Accept=null, string? Cancel=null)
Displays an alert/message box to the user.
Interface for linkable views.
bool IsLinkable
If the current view is linkable.
AuthenticationPurpose
Purpose for requesting the user to authenticate itself.