PHP code example of herald-si / verificac19-sdk-php
1. Go to this page and download the library: Download herald-si/verificac19-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
herald-si / verificac19-sdk-php example snippets
...
Herald\GreenPass\Utils\CertificateValidator;
$gp_string = 'HC1:6BF.......';
$gp_reader = new CertificateValidator($gp_string);
$gp_info = $gp_reader->getCertificateSimple();
// Mostro la struttura dell'esito validazione
echo "<pre>" . print_r($gp_info, true) . "</pre>";
...
//aggiorna lo status dei certificati
Herald\GreenPass\Utils\UpdateService::updateCertificatesStatus();
//aggiorna la lista dei certificati
Herald\GreenPass\Utils\UpdateService::updateCertificateList();
//aggiorna le regole di validazione
Herald\GreenPass\Utils\UpdateService::updateValidationRules();
//aggiorna le liste di revoca
Herald\GreenPass\Utils\UpdateService::updateRevokeList();
// set scan mode to BASE
$scanMode = ValidationScanMode::CLASSIC_DGP;
$gp_reader = new CertificateValidator($gp_string, $scanMode);
Herald\GreenPass\Utils\EnvConfig::enableDebugMode();
... do some test ...
Herald\GreenPass\Utils\EnvConfig::disableDebugMode();
//non viene forzato l'aggiornamento, manca debug mode
Herald\GreenPass\Utils\UpdateService::updateCertificatesStatus(true);
---
//non viene forzato l'aggiornamento, parametro force update a false
Herald\GreenPass\Utils\EnvConfig::enableDebugMode();
Herald\GreenPass\Utils\UpdateService::updateCertificatesStatus();
---
//viene forzato l'aggiornamento, non usare in produzione!
Herald\GreenPass\Utils\EnvConfig::enableDebugMode();
Herald\GreenPass\Utils\UpdateService::updateCertificatesStatus(true);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.