grambas / dcc-verifier
Decode and verify digital COVID-19 certificate against germany signer trust list public key
Requires
- php: ^7.3|^8.0
- ext-json: *
- ext-openssl: *
- ext-zlib: *
- fgrosse/phpasn1: ^2.1
- guzzlehttp/guzzle: ^6.5 || ^7.4
- mhauri/base45: ^0.1.1
- spomky-labs/cbor-php: v2.1.x-dev
- thecodingmachine/safe: ^1.3
- web-auth/cose-lib: ^3.3
Requires (Dev)
- friendsofphp/php-cs-fixer: dev-master
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^8.0 || ^9.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-10-19 02:47:07 UTC
README
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 = new GermanyTrustListClient($trustListDir); $client->update(); // 2. Init existing trust list repository. $trustListRepository = new GermanyTrustListRepository($trustListDir); // 3. Init verfier with qr code content $qrCodeContent = 'HC1:...' $verifier = new DccVerifier($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 = new DateValidator($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.