nzcp

Crates.ionzcp
lib.rsnzcp
version1.0.2
sourcesrc
created_at2021-11-08 09:16:06.197253
updated_at2021-11-17 20:50:25.31716
descriptionAn implementation of NZ COVID verification, New Zealand's proof of COVID-19 vaccination solution
homepage
repositoryhttps://github.com/vaxxnz/nzcp-rust
max_upload_size
id478433
size50,131
Oliver Cooper (oeed)

documentation

README

NZCP Rust   Latest Version Documentation

An implementation of NZ COVID Pass verification, New Zealand's proof of COVID-19 vaccination solution, written in Rust 🦀

We also have a JavaScript implementation available.

Usage

Usage is very straight forward, simply call verify_pass_uri with the scanned QR Code URI. If the given pass is valid the function will return Ok with the pass details, otherwise it will return Err with details of the verification issue.

Add the dependency to your Cargo.toml:

[dependencies]
nzcp = "1.0.2"
use nzcp::{verify_pass_uri, PublicCovidPass};

let barcode = "NZCP:/1/2KCEVIQEIVVWK6JNGEASNICZAEP2KALYDZSGSZB2O5SWEOTOPJRXALTDN53GSZBRHEXGQZLBNR2GQLTOPICRUYMBTIFAIGTUKBAAUYTWMOSGQQDDN5XHIZLYOSBHQJTIOR2HA4Z2F4XXO53XFZ3TGLTPOJTS6MRQGE4C6Y3SMVSGK3TUNFQWY4ZPOYYXQKTIOR2HA4Z2F4XW46TDOAXGG33WNFSDCOJONBSWC3DUNAXG46RPMNXW45DFPB2HGL3WGFTXMZLSONUW63TFGEXDALRQMR2HS4DFQJ2FMZLSNFTGSYLCNRSUG4TFMRSW45DJMFWG6UDVMJWGSY2DN53GSZCQMFZXG4LDOJSWIZLOORUWC3CTOVRGUZLDOSRWSZ3JOZSW4TTBNVSWISTBMNVWUZTBNVUWY6KOMFWWKZ2TOBQXE4TPO5RWI33CNIYTSNRQFUYDILJRGYDVAYFE6VGU4MCDGK7DHLLYWHVPUS2YIDJOA6Y524TD3AZRM263WTY2BE4DPKIF27WKF3UDNNVSVWRDYIYVJ65IRJJJ6Z25M2DO4YZLBHWFQGVQR5ZLIWEQJOZTS3IQ7JTNCFDX";
let pass: PublicCovidPass = verify_pass_uri(barcode).await?;

Pass Types

The library is written in a manner which allows easy addition to the types of passes that can be verified, but to date only the My Vaccine Pass spec has been published.

Pass Name Struct
My Vaccine Pass PublicCovidPass

Usage Outside of Rust

There are plans to provide cross platform libraries using this implementation for other languages, such as web browser WASM and React Native. If you'd like to create your own please do!

Support

See something that can be improved? Report an Issue or contact us to report a security concern.

Want to help us build a better library? We welcome contributions via pull requests and welcome you to our wider Vaxx.nz community on Discord: Join our Discord community.

Commit count: 47

cargo fmt