承接 juancarlo99/pdf-pades-signature-extractor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

juancarlo99/pdf-pades-signature-extractor

Composer 安装命令:

composer require juancarlo99/pdf-pades-signature-extractor

包简介

PHP library to extract PAdES digital signature data from signed PDF files

README 文档

README

EN | PT-BR

English

📄 Overview

PDF PAdES Signature Extractor is a PHP library designed to extract technical data from digital signatures (PAdES) embedded in signed PDF files.

This project was created as a real-world, production-oriented library, focused strictly on data extraction, not on legal or juridical validation.

⚠️ This library does NOT validate the legal authenticity of a digital signature.
It only extracts technical information from the embedded X.509 certificate.

✨ Features

  • Detects PAdES signatures in PDF files
  • Extracts PKCS#7 signature blocks
  • Parses X.509 certificates
  • Extracts:
    • Signer name
    • CPF or CNPJ (ICP-Brasil)
    • Certificate issuer
    • Certificate validity period
    • Basic signature metadata
    • Signing date/time (CMS SigningTime, quando disponível)
    • Cadeia de certificados X.509 (PEM)
  • Built on top of OpenSSL
  • Clean architecture (DTOs, Services, Exceptions)
  • PSR-4 compliant

❌ What this library does NOT do

  • Certificate chain validation (ICP-Brasil)
  • OCSP / CRL verification
  • Timestamp Authority (TSA) validation
  • Legal or juridical validation
  • Signature trust evaluation

🧱 Requirements

  • PHP 8.1+
  • OpenSSL extension enabled
  • PDF signed using the PAdES standard

📦 Installation

composer require juancarlo99/pdf-pades-signature-extractor

🚀 Basic Usage

use Juancarlo99\PdfPadesSignatureExtractor\Extractor\PadesExtractor;

$extractor = new PadesExtractor();
$signature = $extractor->extract('signed.pdf');

echo $signature->signerName;
echo $signature->cpf;
echo $signature->issuer;

📄 License

MIT License

👩‍💻 Development

Using Docker (recommended):

docker compose up -d
docker compose exec app composer install
docker compose exec app vendor/bin/phpunit --no-coverage
docker compose exec app vendor/bin/phpcs --standard=phpcs.xml src tests
docker compose exec app vendor/bin/phpstan analyse -c phpstan.neon

Composer scripts:

composer test
composer lint
composer stan

Sensitive tests

Some tests depend on local sample files and are annotated with the PHPUnit group sensitive. These tests are excluded in GitHub CI.

  • Run all tests locally: vendor/bin/phpunit
  • Run only sensitive tests locally: vendor/bin/phpunit --group sensitive
  • CI excludes them via --exclude-group sensitive in the workflow.

Português (Brasil)

📄 Visão Geral

PDF PAdES Signature Extractor é uma biblioteca PHP criada para extrair dados técnicos de assinaturas digitais PAdES presentes em arquivos PDF assinados.

Este projeto foi desenvolvido como uma biblioteca real e prática, com foco exclusivo em extração de informações, e não em validação jurídica.

⚠️ Esta biblioteca NÃO valida juridicamente a assinatura digital.
Ela apenas extrai dados técnicos do certificado X.509 embutido no PDF.

✨ Funcionalidades

  • Detecta assinaturas PAdES em arquivos PDF
  • Extrai blocos PKCS#7
  • Lê certificados X.509
  • Extrai:
    • Nome do assinante
    • CPF ou CNPJ (ICP-Brasil)
    • Autoridade Certificadora
    • Período de validade do certificado
  • Baseada em OpenSSL
  • Arquitetura limpa (DTOs, Services, Exceptions)
  • Compatível com PSR-4

❌ O que esta biblioteca NÃO faz

  • Validação de cadeia ICP-Brasil
  • Consulta OCSP ou LCR
  • Validação de carimbo do tempo (TSA)
  • Validação jurídica
  • Verificação de confiabilidade da assinatura
  • Inferir o "tipo" do certificado (A1/A3). Essa informação não existe nos padrões PDF / PAdES / CMS / X.509.

🧱 Requisitos

  • PHP 8.1 ou superior
  • Extensão OpenSSL habilitada
  • PDF assinado no padrão PAdES

📦 Instalação

Via Composer:

composer require juancarlo99/pdf-pades-signature-extractor

🚀 Uso Básico

use Juancarlo99\PdfPadesSignatureExtractor\Extractor\PadesExtractor;

$extractor = new PadesExtractor();
$assinatura = $extractor->extract('signed.pdf');

echo $assinatura->signerName;
echo $assinatura->cpf;
echo $assinatura->issuer;
// Preferencialmente usa SigningTime; caso não exista, usa notBefore do certificado
echo $assinatura->signedAt->format('c');
// Acesso opcional ao SigningTime original (DateTimeImmutable|null)
// $assinatura->signingDateTime
// Cadeia de certificados em PEM
foreach ($assinatura->certificates as $pem) {
  // ...
}

// Para múltiplas assinaturas no mesmo PDF
$todas = $extractor->extractAll('signed.pdf');
foreach ($todas as $sig) {
  // processa cada assinatura
}

📄 Licença

MIT License

juancarlo99/pdf-pades-signature-extractor 适用场景与选型建议

juancarlo99/pdf-pades-signature-extractor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 juancarlo99/pdf-pades-signature-extractor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 juancarlo99/pdf-pades-signature-extractor 我们能提供哪些服务?
定制开发 / 二次开发

基于 juancarlo99/pdf-pades-signature-extractor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-20