Crates.io | gatekeeper-core |
lib.rs | gatekeeper-core |
version | 0.2.1 |
source | src |
created_at | 2024-02-18 20:52:53.034354 |
updated_at | 2024-02-18 23:21:13.779308 |
description | Library for authenticating gatekeeper tags |
homepage | |
repository | https://github.com/ComputerScienceHouse/gatekeeper-core |
max_upload_size | |
id | 1144380 |
size | 36,920 |
gatekeeper-core
is a library for interfacing with gatekeeper NFC tags.
If you're interested in making a project using gatekeeper, you're free to
use this library, but you might prefer using
gatekeeper-members
which adds support for validating tags against the gatekeeper server,
getting secrets from environment variables, and provides a higher-level
interface that should reduce boilerplate for most common usecases.
It's pretty easy to connect to a reader and find tags:
let mut gatekeeper_reader =
GatekeeperReader::new("pn532_uart:/dev/ttyUSB0".to_string(), realm)
.expect("Failed to open gatekeeper");
for tag in gatekeeper_reader.get_nearby_tags() {
if let Ok(association_id) = tag.authenticate() {
println!("Association ID for tag: {association_id}");
}
}
Check out the
examples
directory for a more comprehensive example.
Make sure you have libfreefare and libnfc installed. Loads of distributions package these.
If you're having trouble, try building these versions locally, which are known to work well: