PHPackages                             lufox11/pdf-sign-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. lufox11/pdf-sign-validator

ActivePackage[PDF &amp; Document Generation](/categories/documents)

lufox11/pdf-sign-validator
==========================

A simple wrapper to validate a PDF signature against a public key.

1.2.0(4y ago)0301MITPHPPHP &gt;=7.2

Since Feb 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LufoX11/pdf-sign-validator)[ Packagist](https://packagist.org/packages/lufox11/pdf-sign-validator)[ RSS](/packages/lufox11-pdf-sign-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

PDF Sign Validator
==================

[](#pdf-sign-validator)

PDF Sign Validator is a simple wrapper to validate a PDF signature against a public key.
After spending an entire day looking for a similar solution I gave up and ended up building a solution by myself with the help of my best friend, John Stack Overflow.
This is nothing more than just a wrapper of real cryptographic functions from [Sop\\ANS1](https://github.com/sop/asn1) and [Sop\\X509](https://github.com/sop/x509) repositories.

Installation
------------

[](#installation)

Just require this package in your project using Composer:

```
composer require lufox11/pdf-sign-validator
```

Usage
-----

[](#usage)

Methods you may'd like to use:

**signCount**: Returns the amount of signatures found in file.
**signIsValid**: Validates that the file signature corresponds to the issuer's root PEM certificate.
**certIsValid**: Validates that the subject certificate was issued by the issuer certificate.
**signMatchSubject**: Validates that the certificate (extracted from the signature) match the subject's PEM certificate.
**infoFromPDF**: Reads an attached signature to a PDF file and returns the info inside.
**infoFromPEM**: Reads a certificate in PEM format and returns the info inside.

A real use case (Argentina):

1. Sign a PDF file through [Firmar.gob.ar](https://firmar.gob.ar/firmador/#/) and download the file (`signed.pdf`).
2. [Download](https://www.acraiz.gob.ar/Content/Archivos/certificados/licenciados_acraiz2016/01.crt) the issuer's root certificate (`issuer.cer`).
3. [Download](https://firmar.gob.ar/RA/system/home#/certificados) your public certificate (`subject.cer`).

```
use LufoX11\PdfSignValidator\PdfSignValidator;

/**
 * signed.pdf: Path to the signed PDF file.
 * issuer.cer: Path to the public key file (RSA PUBLIC KEY) of the issuer.
 * subject.cer: Path to the public key file (RSA PUBLIC KEY) of the subject.
 */

$amountOfSignatures = PdfSignValidator::signCount('signed.pdf');
$certificateIsValid = PdfSignValidator::certIsValid('subject.cer', 'issuer.cer');
$certificateData = PdfSignValidator::infoFromPEM('certificate.cer');
$certificateData = PdfSignValidator::infoFromPDF('signed.pdf');

// Single signature in PDF file
$signatureIsValid = PdfSignValidator::signIsValid('signed.pdf', 'issuer.cer');
$certificateMatchSubject = PdfSignValidator::signMatchSubject('signed.pdf', 'subject.cer');

// Multiple signatures in PDF file
// You can specify the signature to work with in dot notation
$signatureIsValid = PdfSignValidator::signIsValid('signed.pdf', 'issuer.cer', [ 'subject.common_name' => 'Lionel Messi' ]);
$certificateMatchSubject = PdfSignValidator::signMatchSubject('signed.pdf', 'subject.cer', [ 'issuer.common_name' => 'Magnus Carlsen' ]);
```

License
-------

[](#license)

This project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

1574d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8cd1fa291982a482d60e9985bc5659ab7ea570a4aa55427f1f0cd92899e58ff?d=identicon)[LufoX11](/maintainers/LufoX11)

---

Top Contributors

[![LufoX11](https://avatars.githubusercontent.com/u/819192?v=4)](https://github.com/LufoX11 "LufoX11 (1 commits)")

### Embed Badge

![Health badge](/badges/lufox11-pdf-sign-validator/health.svg)

```
[![Health](https://phpackages.com/badges/lufox11-pdf-sign-validator/health.svg)](https://phpackages.com/packages/lufox11-pdf-sign-validator)
```

###  Alternatives

[42coders/document-templates

Document template management package.

19940.0k](/packages/42coders-document-templates)[qipsius/tcpdf-bundle

A bundle to easily integrate TCPDF into Symfony

23749.5k](/packages/qipsius-tcpdf-bundle)[macopedia/magmi2

Magento Mass Importer 'Magmi' for Magento 2

11615.7k](/packages/macopedia-magmi2)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.4k](/packages/tarfin-labs-easy-pdf)[ikkez/f3-sheet

Some Excel and CSV utilities for PHP Fat-Free Framework

1414.8k](/packages/ikkez-f3-sheet)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.7k](/packages/nilgems-laravel-textract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
