A PHP library to read and validate EU Digital COVID Certificates

Overview

CovPassCheck PHP

A PHP library to read and validate EU Digital COVID Certificates.

Install

composer require stwon/covpasscheck-php

Usage

Currently, the library only ships with a file based trust store. You need to download and store valid certificates manually or implement your own custom TrustStore class. The FileTrustStore reads JSON files matching the schema described here. Note that you MUST NOT include the signature part (i.e. first line) of DSC TrustList Update API responses.

$trustStore = new FileTrustStore('./certs.json');
$check = new CovPassCheck($trustStore);

try {
    // This is the scanned QR code content ↓
    $certificate = $check->readCertificate('HC1:...');

    $subject = $certificate->getSubject();

    if ($certificate->isCovered(Target::COVID19, HealthCertificate::TYPE_VACCINATION | HealthCertificate::TYPE_RECOVERY)) {
        $this->line($subject->getFirstName() . ' does conform to 2G rules.');
    } else {
        $this->line($subject->getFirstName() . ' does not conform to 2G rules.');
    }
} catch (InvalidSignatureException $exception) {
    // oh noo
}

License

See LICENSE.md.

You might also like...
PHP functions that help you validate structure of complex nested PHP arrays.

PHP functions that help you validate structure of complex nested PHP arrays.

This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks

SMPirepValidator This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks SMPirepValidator v.1.0 for phpVMS (

This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify that a number is indeed a number of an operator X

phone-number-checker This package is used to validate the telephone numbers of the countries taken into account. It also makes it possible to verify t

CC [CREDIT CARD] GENERATE & VALIDATE TOOL !
CC [CREDIT CARD] GENERATE & VALIDATE TOOL !

⚡ CCE THIS TOOL PERMIT YOU TO GENERATE CREDIT CARD & VALIDATE

This Validate Class is for those who are looking for a validator that returns a code for every each error (Laravel/Api)
This Validate Class is for those who are looking for a validator that returns a code for every each error (Laravel/Api)

Validator-Class This Validate Class is for those who are looking for a validator that returns a code for every each error (Laravel/Api) Requirements A

[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Utility Classes This library provides a range of utility classes that are used throughout the CakePHP framework What's in the toolbox? Hash A

Easily create and read Corona Warn App Check-In URLs

bauer-kirch/cwa-event-registration-url This PHP library allows generating Check-In URLs for the Corona Warn App which can then be used to generate a Q

Learn how to run WordPress with Docker. Read about our experiences and start off with an easy boilerplate.
Learn how to run WordPress with Docker. Read about our experiences and start off with an easy boilerplate.

Hi! We're Dan and Jay. We're a two person team with a passion for open source products. We created Server Side Up to help share what we learn. Find us

Read and show values from form valid

read-and-show-values-from-form-valid Escribe un programa PHP que permita al usuario rellenar un formulario de registro con los datos de nombre, contra

Comments
  • Update cbor php

    Update cbor php

    The package looks great and really want to give it a try, thank you for the work that you have done on it :)

    The branch for the php-cbor no longer exists as that development branch has been merged into v2.0, here.

    Let me know if there are any issues.

    opened by SamMoffat 1
  • CovPass-Check-app does not show number and date of vaccination

    CovPass-Check-app does not show number and date of vaccination

    some legislations have exceptions especially for people with vaccinations within certain time frames and for people with a third ("booster") vaccination. The CovPass-Check-app currently displays neither the date of the vaccination nor the number of total received vaccinations after scanning a certificate QR-code.

    wontfix 
    opened by adgoctic 0
  • Composer cannot resolve requirements

    Composer cannot resolve requirements

    I'm new in php, sorry if something bad and not accurate in my issue. I'm trying to install package via composer but get the next error:

    composer require stwon/covpasscheck-php
    
      Problem 1
        - Root composer.json requires stwon/covpasscheck-php 1.5.1 -> satisfiable by stwon/covpasscheck-php[1.5.1].
        - stwon/covpasscheck-php 1.5.1 requires spomky-labs/cbor-php dev-byte-string-encode-fix -> found spomky-labs/cbor-php[dev-Preparation2.0, v1.0.0, ..., v1.1.x-dev, v2.0.0, v2.0.1, v2.0.x-dev, v2.1.x-dev, v3.0.x-dev] but it does not match the constraint.
    

    I went to https://github.com/Spomky-Labs/cbor-php repository and didn't find dev-byte-string-encode-fix version there. Could you fix requirements? Or help me with avoiding a problem.

    opened by 0ro 1
Owner
Studentenwerk OstNiedersachsen
Studentenwerk OstNiedersachsen
Dashboard autônoma que mostra os dados gerais da campanha de vacinação contra a Covid-19 do Estado de Mato-Grosso

Vacinometro Covid-19 MT Web App Demo: https://vacinometro-mt.netlify.app/ Dashboard que mostra o progresso da campanha de vacinação da Covid-19 no est

Samuel Araujo 1 May 2, 2022
PHP project for tracking Azure AD App Reg secrets about to expire, and (manually) tracking SSL certificates

CertExpiry Katy Nicholson https://katystech.blog/ Setup instructions etc available at: https://katystech.blog/2021/11/certexpiry/ PHP project for trac

Katy Nicholson 5 Oct 2, 2022
PHP library to create and validate html forms

FormManager Note: this is the documentation of FormManager 6.x For v5.x version Click here Installation: This package requires PHP>=7.1 and is availab

Oscar Otero 145 Sep 20, 2022
Columnar analytics for PHP - a pure PHP library to read and write simple columnar files in a performant way.

Columnar Analytics (in pure PHP) On GitHub: https://github.com/envoymediagroup/columna About the project What does it do? This library allows you to w

Envoy Media Group 2 Sep 26, 2022
Jéssica Paula 7 Aug 12, 2022
Xero - a digital currency that allows instant payments to anyone, anywhere

Xeros is a digital currency that allows instant payments to anyone, anywhere. Xeros has been written completely in PHP and mostly follows the technical design of Bitcoin. Xeros uses P2P technology to operate with no central server.

Kladskull 79 Dec 26, 2022
API de automação para assinatura digital da plataforma CLICKSIGN

API PARA ASSINATURA DIGITAL COM PHP API de automação para assinatura digital da plataforma CLICKSIGN usando PHP API básica, para mais funcionalidades

null 5 Aug 13, 2022
Open Source Data & Experience Management Platform (PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce)

Pimcore - Open Source Data & Experience Management Platform: PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce

Pimcore 2.7k Jan 4, 2023
Basic class library to read, write and view files using PHP.

File Basic class library to read, write and view files using PHP. Supported PHP Versions Build Status (dev) Main Aim of The Library The main aim of th

WebFiori 2 May 13, 2022
JSON schema models and generated code to validate and handle various data in PocketMine-MP

DataModels JSON schema models and generated code to validate and handle various data in PocketMine-MP This library uses php-json-schema-model-generato

PMMP 2 Nov 9, 2022