verificac19 1.0.4 copy "verificac19: ^1.0.4" to clipboard
verificac19: ^1.0.4 copied to clipboard

outdated

Unofficial EU Digital Green Certificate validation SDK for Flutter apps

Flutter pub package pub points popularity likes

About #

This package allows to decode and validate any EU Digital Green Certificate in your Flutter application. It is based on the specications contained in the official it-dgc-verificac19-sdk-android repository. For now it only supports the download of validation rules from the Italian Backend.

Development & testing #

  • Clone the repository
git clone https://github.com/mastro993/verificac19_flutter.git
  • Get packages
cd verificac19_flutter

flutter pub get

Installation #

flutter pub add verificac19

Usage #

Setup #

First thing to do is to initialize the package. This allows to all internal initializations to be done.

await VerificaC19.initialize();

Download and cache rules, CRL data and DSCs #

You can download and cache rules, CRL data and DSCs using the update function.

await VerificaC19.update();

Verify a DGC #

You can decode and get a Certificate object from raw data using the getCertificateFromRaw function

Certificate cert = await VerificaC19.getCertificateFromRaw('HC1:NCFOXN%TSMAHN-H3ZSUZK+.V0ET9%6-AH...');

You can verify a DGC from a Certificate object or directly base45 encoded raw data.

// Validate Certificate object
ValidationResult result = await VerificaC19.validateCertificate(cert);
// or base45 encoded raw data
ValidationResult result = await VerificaC19.validateFromRaw('HC1:NCFOXN%TSMAHN-H3ZSUZK+.V0ET9%6-AH...');

ValidationResult object contains a CertificateStatus which can have the following values:

Code Description
valid Certificate is valid
notValid Certificate is not valid
notValidYet Certificate is not valid yet
notEuDCC Certificate is not an EU DCC

You can also provide a ValidationMode parameter.

Code Description
normalDGP Normal verification (default value)
superDGP Super Green Pass verification

Example:

ValidationResult result = await VerificaC19.validateCertificate(cert, mode: ValidationMode.normalDGP);
// or
ValidationResult result = await VerificaC19.validateCertificate(cert, mode: ValidationMode.superDGP);

Examples #

An example application is currently WIP.

TODOs #

  • ❌ Add the ability to retrieve/validate a Certificate from image
  • ❌ Add the ability to custom data providers other than the Italian one (https://get.dgc.gov.it/v1/dgc)
3
likes
0
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

Unofficial EU Digital Green Certificate validation SDK for Flutter apps

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

archive, asn1lib, cbor, clock, crypto, crypto_keys, dart_base45, dio, flutter, hive, hive_flutter, json_annotation, json_serializable, ninja, retrofit, x509b

More

Packages that depend on verificac19