Skip to content

Repository files navigation

dcc-verifier

Latest Version on PackagistSoftware LicensecoverageTotal Downloads

Alpha version of digital COVID-19 verification implementation with php.

Install

Via Composer

$ composer require grambas/dcc-verifier

Demo

This SDK is used in Demo API Project- dcc-verifier.de which is also open sourced at grambas/dcc-verifier-api

Info

This package implements Germany public trust list api repository. More about api - Open API specification

Features

  • Decode and read EU Digital COVID-19 Certificate data (DCC) of vaccination, recovery or test (PCR, Rapid) subject
  • Validate DCC date of expiry
  • Validate DCC against authoritative signer signature
  • Use Germany trust list
  • Ability to use own trust list repository

Usage

$trustListDir = '/tmp/de-trust-list'; // local dir for saving trust list json file// 1. Download / Update Germany signer trust list$client = newGermanyTrustListClient($trustListDir);
$client->update();
// 2. Init existing trust list repository.$trustListRepository = newGermanyTrustListRepository($trustListDir);
// 3. Init verfier with qr code content$qrCodeContent = 'HC1:...'$verifier = newDccVerifier($qrCodeContent, $trustListRepository);
// 4. Decode & verify$dcc = $verifier->decode(); // get certificate info$verifier->verify(); // validate against signer signature// 5. Validate if Certificate (Vaccination, Recovery or Test) conforms specific business rules for example if// fully vaccinated or test is negetive$isValid = $dcc->isValid()
// 6. Check certificate validation date$validator = newDateValidator($dcc);
$isValidForDate = $validator->isValidForDate(new \DateTime());

Of course validation steps 4. 5. and 6 can be checked independently and in your preferred order

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ make test
$ make coverage

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email milius@mindau.de instead of using the issue tracker.

Credits

License

The MIT License (MIT), see License File and NOTICE for more information.

About

Decode and verify EU Digital COVID-19 Certificates

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages