#tags #gatekeeper #nfc #interfacing #secret #authenticating #reader

gatekeeper-core

Library for authenticating gatekeeper tags

3 unstable releases

0.2.1 Feb 18, 2024
0.2.0 Feb 18, 2024
0.1.0 Feb 18, 2024

#2 in #gatekeeper

Download history 8/week @ 2024-08-29 3/week @ 2024-09-05 8/week @ 2024-09-12 22/week @ 2024-09-19 22/week @ 2024-09-26 8/week @ 2024-10-03 5/week @ 2024-10-10 5/week @ 2024-10-17 4/week @ 2024-10-24 10/week @ 2024-10-31 7/week @ 2024-11-07 1/week @ 2024-11-14 6/week @ 2024-11-21 8/week @ 2024-11-28 21/week @ 2024-12-05 18/week @ 2024-12-12

53 downloads per month
Used in gatekeeper-members

MIT license

29KB
679 lines

gatekeeper-core

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.

Example

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.

Dependencies

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:

Dependencies

~2.1–3MB
~69K SLoC