0 purchases
verificac19
VerificaC19 package for Flutter #
About #
This package allows to decode and validate any EU Digital Green Certificate in your Flutter application. It is based on the specifications contained in the official it-dgc-verificac19-sdk-android repository.
This library requires an internet connection to download and cache rules, CRL and DSCs at least once per day. Once updated the entire process of validation can be done completely offline and in real-time.
Starting from version 1.4.3, this package has been included in the list of verified SDKs by Italian authorities (Ministero della salute).
Development & testing #
Clone the repository
git clone https://github.com/mastro993/verificac19_flutter.git
copied to clipboard
Get packages
cd verificac19_flutter
flutter pub get
copied to clipboard
QR codes for testing can be obtained from this link: https://dgc.a-sit.at/ehn/testsuite
Installation #
flutter pub add verificac19
copied to clipboard
Example app #
An example application can be seen here.
Usage #
Setup #
First thing to do is to initialize the package. This allows to all internal initializations to be done.
await VerificaC19.initialize();
copied to clipboard
Download and cache rules, CRL data and DSCs #
You can download and cache rules, CRL data and DSCs using the update function. This will update data only if the 24 hours update window is expired.
await VerificaC19.update();
copied to clipboard
You can also check if the data is expired (older than the 24 hours update window) without requiring an update with the needsUpdate function.
bool requiresUpdate = await VerificaC19.needsUpdate();
copied to clipboard
Verify and validate a DGC #
You can verify and validate a DGC from a String containing a base45 encoded data.
// Validate frombase45 encoded data
ValidationResult result = await VerificaC19.validateFromRaw('HC1:NCFOXN%TSM...');
copied to clipboard
The result is a ValidationResult object containing the decoded Certificate object and its CertificateStatus which can have the following values:
Code
Description
✅
valid
Certificate is valid
⚠
testNeeded
Test needed if verification mode is boosterDGP
❌
notValid
Certificate is not valid
❌
notValidYet
Certificate is not valid yet
❌
revoked
Certificate has been revoked
❌
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.validateFromRaw('HC1:NCFOXN%TSM...', mode: ValidationMode.normalDGP);
// or
ValidationResult result = await VerificaC19.validateFromRaw('HC1:NCFOXN%TSM...', mode: ValidationMode.superDGP);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.