1. Go to this page and download the library: Download beziworld/laravel-xades 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/ */
$result = Xades::verify($signedXml); // throws InvalidSignature
$result->packaging; // Packaging::Enveloped, Enveloping or Detached
$result->profile; // Profile::Bes or Profile::BaselineB
$result->certificate; // CertificateInfo: subject, issuer, serialNumber, fingerprint, validFrom, validTo
$result->certificate->nip(); // NIP from organizationIdentifier VATPL-... or serialNumber TINPL-...
$result->certificate->pesel();// PESEL from serialNumber PNOPL-...
$result->signingTime; // CarbonImmutable (UTC) or null
$result->trusted; // true/false against the trust list, null when no list is configured
$result->coversWholeDocument; // true when the whole document (minus the signature) is signed
$result->signedContents; // canonical XML of what the signature covers
$result->claimedRoles;
$result->commitmentType;
$result->warnings; // findings that do not invalidate the signature
Xades::isValid($signedXml); // bool
Xades::verify($signatureXml, ['detached' => ['faktura.pdf' => $pdfBytes]]);
Xades::verify($signedXml, ['trusted' => [storage_path('ca/issuer.pem')], '
use Beziworld\Xades\Rules\ValidXadesSignature;
$request->validate([
'document' => ['r.pem')])->withSchema()],
]);
Xades::validateSchema($signedXml); // throws SchemaViolation with errors(), returns the number of signatures
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.