#verification #covid-19 #vaccination #vaccine

nzcp

An implementation of NZ COVID verification, New Zealand's proof of COVID-19 vaccination solution

3 stable releases

1.0.2 Nov 17, 2021
1.0.1 Nov 8, 2021

#4 in #covid-19

MIT license

41KB
847 lines

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.

Dependencies

~27–43MB
~802K SLoC