VerificaC19-flutter - Unofficial EU DGC validation package for Flutter

Overview

VerificaC19 package for Flutter

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.

This library requires an internet connection to downlod 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.

Note: this library currently only supports the download of rules, CRL and DSCs from the Italian Backend (https://get.dgc.gov.it/v1/dgc)

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. This will update data only if the 24 hours update window is expired.

await VerificaC19.update();

You can optionally pass the force parameter to force the update before the 24 hours expiry window, but only after 1 hour from the last update.

await VerificaC19.update(force: true);

You can also check if the data is expired (older than the 24 hours update window) without requiring an update with the needUpdate function.

bool requiresUpdate = await VerificaC19.needsUpdate();

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 an image file
  • Add the ability to implement rules providers from other countries
You might also like...

Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter

Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter

Turkish Dictionary Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter Design Feyza Nur Demirci Şahin Abut

Oct 20, 2022

Flutter & Dart Unofficial Flat Data API

Flutter & Dart Unofficial Flat Data API Flat Dataset for different helpful Flutter APIs Flutter Releases Currently does a daily snapshot of the Flutte

Dec 26, 2022

An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS

Pusher Flutter Client An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS. Get it from pub. How

Oct 21, 2022

Vrchat mobile client - VRChat Unofficial Mobile Client For Flutter

Vrchat mobile client - VRChat Unofficial Mobile Client For Flutter

VRChatMC VRChatの非公式なAPIを利用したVRChatのモバイルクライアント Flutterで作成されたシンプルなUIが特徴的です iosビルドは

Sep 28, 2022

An unofficial wrapper for the kdecole api

This is an UNOFFICIAL wrapper for the kdecole api How to use ? Login First, you need to create a Client() object : LOGIN AND PASSWORD ARE NOT YOUR ENT

Nov 2, 2022

unofficial windows client for smotreshka.tv

smotreshka Rebuild models flutter pub run build_runner build --delete-conflicting-outputs Getting Started This project is a starting point for a Flut

Dec 3, 2021

Unofficial 🐘 client written in 🎯

mastodon_dart The official Dart library for accessing the Mastodon API. Optionally use in conjunction with mastodon_flutter to build a Flutter Mastodo

Dec 22, 2022

Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.

An unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart. This package is using logging package to do the actual logging,

Mar 3, 2021

An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

DioHub for Github Summary Features Roadmap Support Screenshots Build Instructions Summary DioHub is an open-source unofficial GitHub mobile client, th

Jan 4, 2023
Comments
  • Rimuovere la modalità scuola

    Rimuovere la modalità scuola

    Rimuovere la modalità scuola secondo il DECRETO-LEGGE 4 febbraio 2022, n. 5

    La condizione sanitaria che consente la didattica in presenza di
    cui al comma 1, lettera b), numero 2, primo periodo,  e  lettera  c),
    numero 2), primo periodo, puo' essere controllata  dalle  istituzioni
    scolastiche mediante l'applicazione  mobile  per  la  verifica  delle
    certificazioni verdi COVID-19 di cui al decreto  del  Presidente  del
    Consiglio dei ministri adottato ai sensi dell'articolo 9,  comma  10,
    del  decreto-legge  22  aprile   2021,   n.   52,   convertito,   con
    modificazioni, dalla legge 17  giugno  2021,  n.  87.  L'applicazione
    mobile  di  cui  al  primo  periodo  e'  tecnicamente   adeguata   al
    conseguimento delle  finalita'  del  presente  comma  e  puo'  essere
    impiegata anche nelle more dell'aggiornamento del decreto di  cui  al
    primo periodo. 
    
    opened by astagi 3
  • Nuova modalità ingresso IT

    Nuova modalità ingresso IT

    Implementare nuova modalità di ingresso IT con regole per ingresso a utenti di età inferiore ai 18 anni, nello specifico sono state sviluppate lato SDK Android le seguenti funzionalità:

    • aggiunte nuove impostazioni per la durata della vaccinazione completa per utenti di età inferiore ai 18 anni: vaccino_end_day_complete_under_18 per il numero di giorni da aggiungere e under_18_offset per aggiungere eventualmente alcuni giorni in modo da consentire agli utenti di completare la vaccinazione pochi giorni dopo aver compiuto 18 anni
    • aggiunta nel regolamento entry italy factory per applicare verifica con nuove impostazioni
    • aggiunta funzione per controllare l'età della persona per verificare se l'età è inferiore a 18

    Commit di riferimento qui

    opened by astagi 1
  • Rimuovere modalità lavoro, diventerà base

    Rimuovere modalità lavoro, diventerà base

    In vista dell'aggiornamento SDK apro qua una richiesta di cambiamento per il SDK in questione.

    L'opzione è stata eliminata in quanto fino al 30 aprile è possibile per tutti, compresi gli over 50, accedere ai luoghi di lavoro con il green pass BASE, come previsto dal DECRETO-LEGGE 24 marzo 2022, n. 24.

    opened by astagi 1
  • Inserire l'apposito header User-agent nelle richieste verso le API

    Inserire l'apposito header User-agent nelle richieste verso le API

    Inserire all'interno delle richieste verso le API l'apposito header User-Agent nella forma

    User-Agent: <sdk>-<sdk-technology>/<sdk-version>
    

    È possibile omettere -<sdk-technology> se la tecnologia è già specificata nel nome (ad esempio verificac19-sdk-php).

    Ad esempio nel caso verificac19-sdk per Node.js lo User-Agent sarà

    User-Agent: verificac19-sdk-node/0.9.3
    
    opened by astagi 1
Owner
Federico Mastrini
Software Engineer, Web and Mobile. Always looking for something to create.
Federico Mastrini
A Dart validation DSL to validate your flutter app models.

Validations made simple A fp inspired validation DSL. For Dart and Flutter projects. Features Completely extensible (create your own combinators, vali

Daniel Cardona Rojas 26 Feb 8, 2022
Rules - Powerful and feature-rich validation library for both Dart and Flutter.

Introduction Rules - Powerful and feature-rich validation library for both Dart and Flutter. Rules is a simple yet powerful and feature-rich validatio

Ganesh Rathinavel 24 Dec 12, 2022
Sample Flutter app for creating basic login forms validation for email and passwords

Email validation Flutter example Sample flutter app showing how to validate a e-mail login form. This example uses the email_validator package for val

Fredrik Eilertsen 22 Dec 15, 2022
Flutter Plugin - Simple character blocked input that usually used for redeem/validation input.

Block Input Simple character blocked input that usually used for redeem code or validation code input. Gallery Example Full example import 'package:bl

Enkh-Amar 7 Nov 2, 2022
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Abdullah Chauhan 22 Dec 29, 2022
Using all validation logics.

new_login A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Hemant Gauhai 1 Feb 28, 2022
Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

password_strength_checker Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation wit

Dario Varriale 6 Aug 8, 2023
Flutter list view - An unofficial list view for flutter

Flutter List View I don't like official list view. There are some features don't

null 24 Dec 15, 2022
The unofficial flutter plugin for Freshchat

?? Flutter Freshchat A Flutter plugin for integrating Freshchat in your mobile app. Setup Android Add this to your AndroidManifest.xml <provider a

Fayeed Pawaskar 31 Jun 2, 2022
Unofficial delivery app for Rapidinho made with Flutter

Rapidinho Unofficial delivery app for Rapidinho made with Flutter Getting Started Gradle version: 4.6 Flutter version: 0.8.3 Install Flutter Clone thi

GDG Luanda 190 Dec 26, 2022