PHPackages                             baldwin94/pdf-signature-extractor - 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. baldwin94/pdf-signature-extractor

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

baldwin94/pdf-signature-extractor
=================================

Helper para extraer datos de certificados digitales de PDFs firmados con soporte PKCS#7

v0.1.1(3mo ago)015↓100%MITPHPPHP ^8.0

Since Nov 21Pushed 3mo agoCompare

[ Source](https://github.com/Baldwin94/pdf-signature-extractor)[ Packagist](https://packagist.org/packages/baldwin94/pdf-signature-extractor)[ RSS](/packages/baldwin94-pdf-signature-extractor/feed)WikiDiscussions master Synced today

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

PDF Signature Extractor
=======================

[](#pdf-signature-extractor)

Helper para extraer datos de certificados digitales de PDFs firmados con soporte PKCS#7.

Características
---------------

[](#características)

- ✅ Extrae datos de firmas digitales en PDFs
- ✅ Soporta formato PKCS#7
- ✅ Obtiene información del firmante (nombre, apellidos, DNI)
- ✅ Extrae fecha de firma
- ✅ Extrae fecha de caducidad del certificado
- ✅ Verifica si un PDF tiene firmas digitales

Requisitos
----------

[](#requisitos)

- PHP 8.0 o superior

Instalación
-----------

[](#instalación)

```
composer require baldwin94/pdf-signature-extractor
```

Uso
---

[](#uso)

### Verificar si un PDF tiene firmas

[](#verificar-si-un-pdf-tiene-firmas)

```
use Baldwin94\PdfSignatureExtractor\PdfSignatureExtractor;

$pdfPath = '/ruta/al/documento.pdf';

if (PdfSignatureExtractor::hasSignatures($pdfPath)) {
    echo "El PDF tiene firmas digitales";
} else {
    echo "El PDF no tiene firmas digitales";
}
```

### Extraer firmas de un PDF

[](#extraer-firmas-de-un-pdf)

```
use Baldwin94\PdfSignatureExtractor\PdfSignatureExtractor;

$pdfPath = '/ruta/al/documento.pdf';

try {
    $signatures = PdfSignatureExtractor::extractSignatures($pdfPath);

    foreach ($signatures as $signature) {
        echo "Fecha de firma: " . $signature['signature_date'] . "\n";
        echo "Fecha de caducidad del certificado: " . ($signature['certificate_expiry'] ?? 'N/A') . "\n";

        if (isset($signature['signature_info'])) {
            $info = $signature['signature_info'];

            echo "Nombre: " . ($info['given_name'] ?? 'N/A') . "\n";
            echo "Apellidos: " . ($info['surname'] ?? 'N/A') . "\n";
            echo "DNI: " . ($info['serial_number'] ?? 'N/A') . "\n";
        }
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

### Uso en Laravel

[](#uso-en-laravel)

```
use Baldwin94\PdfSignatureExtractor\PdfSignatureExtractor;

class DocumentController extends Controller
{
    public function verifySignature(Request $request)
    {
        $pdfPath = $request->file('pdf')->getRealPath();

        if (!PdfSignatureExtractor::hasSignatures($pdfPath)) {
            return response()->json([
                'error' => 'El PDF no tiene firmas digitales'
            ], 400);
        }

        $signatures = PdfSignatureExtractor::extractSignatures($pdfPath);

        return response()->json([
            'signatures' => $signatures
        ]);
    }
}
```

Estructura de datos retornada
-----------------------------

[](#estructura-de-datos-retornada)

```
[
    [
        'signature_date' => '2024-01-15 10:30:45',
        'certificate_expiry' => '2027-01-15 23:59:59',
        'signature_info' => [
            'given_name' => 'Juan',
            'surname' => 'García López',
            'serial_number' => '12345678'
        ]
    ]
]
```

Contribuciones
--------------

[](#contribuciones)

Las contribuciones son bienvenidas. Por favor:

1. Fork el proyecto
2. Crea una rama para tu feature (`git checkout -b feature/AmazingFeature`)
3. Commit tus cambios (`git commit -m 'Add some AmazingFeature'`)
4. Push a la rama (`git push origin feature/AmazingFeature`)
5. Abre un Pull Request

Licencia
--------

[](#licencia)

Este proyecto está licenciado bajo la Licencia MIT - ver el archivo [LICENSE](LICENSE) para más detalles.

Autor
-----

[](#autor)

**Baldwin94**

Soporte
-------

[](#soporte)

Si encuentras algún problema o tienes sugerencias, por favor abre un [issue](https://github.com/Baldwin94/pdf-signature-extractor/issues).

###  Health Score

32

—

LowBetter than 74% of packages

Maintenance79

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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 ~11 days

Total

2

Last Release

111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/142a330dd06b4dcbe08bfb894127426bbca297369738a18742e4f1c3f77788ca?d=identicon)[baldwin94](/maintainers/baldwin94)

---

Top Contributors

[![Baldwin94](https://avatars.githubusercontent.com/u/89361762?v=4)](https://github.com/Baldwin94 "Baldwin94 (2 commits)")

---

Tags

pdfsignaturecertificatepkcs7digital-signaturepdf-parser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/baldwin94-pdf-signature-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/baldwin94-pdf-signature-extractor/health.svg)](https://phpackages.com/packages/baldwin94-pdf-signature-extractor)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k84.4M232](/packages/barryvdh-laravel-dompdf)[tecnickcom/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k99.3M414](/packages/tecnickcom-tcpdf)[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k75.3M433](/packages/mpdf-mpdf)[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k66.9M49](/packages/knplabs-knp-snappy)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k30.7M85](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k32.8M187](/packages/smalot-pdfparser)

PHPackages © 2026

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