PHPackages                             filippo-toso/p7m-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. filippo-toso/p7m-extractor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

filippo-toso/p7m-extractor
==========================

A simple class that allows to extract the original file from a signed p7m file.

v1.1.3(3y ago)517.0k↓36.1%6MITPHPPHP ^7.0|^8.0|^9.0CI failing

Since Jan 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/filippotoso/p7m-extractor)[ Packagist](https://packagist.org/packages/filippo-toso/p7m-extractor)[ RSS](/packages/filippo-toso-p7m-extractor/feed)WikiDiscussions master Synced 1mo ago

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

P7M Extractor
=============

[](#p7m-extractor)

A simple class that allows to extract the original file from a signed p7m file.

Requirements
------------

[](#requirements)

- PHP 7.0+
- Symphony Prcess 3.3 or 4.0+

Requirements
------------

[](#requirements-1)

Behind the scenes this package leverages [openssl](https://it.wikipedia.org/wiki/OpenSSL). You can verify if the binary installed on your system by issueing this command:

```
which openssl
```

If it is installed it will return the path to the binary.

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

[](#installation)

You can install the package via composer:

```
composer require filippo-toso/p7m-extractor
```

Usage
-----

[](#usage)

Extracting text from a pdf is easy.

```
use FilippoToso\P7MExtractor\P7M;

$success = (new P7M())
    ->setSource('source.pdf.p7m')
    ->setDestination('destination.pdf')
    ->save();
```

Or easier:

```
use FilippoToso\P7MExtractor\P7M;

$success = P7M::convert('source.pdf.p7m', 'destination.pdf');
```

By default the package will assume that the `openssl` command is located at `/usr/bin/openssl`. If it is located elsewhere pass its binary path to constructor

```
use FilippoToso\P7MExtractor\P7M;

$success = (new P7M('/custom/path/to/openssl'))
    ->setSource('source.pdf.p7m')
    ->setDestination('destination.pdf')
    ->save();
```

or as the last parameter to the `extract()` static method:

```
$success = P7M::convert('source.pdf.p7m', 'destination.pdf', '/custom/path/to/openssl');
```

If you want to get the content as a string instead of saving it to a file you can use the `get()` method or the `extract()` static method.

If you need to change the command or add additional parameters to openssl, you can use the `setParams()` methods

```
use FilippoToso\P7MExtractor\P7M;

$success = (new P7M('/custom/path/to/openssl'))
    ->setParams(['{$openssl}', 'cms', '-verify', '-noverify', '-no_attr_verify', '-binary', '-in', '{$source}', '-inform', 'DER', '-out', '{$destination}'])
    ->setSource('source.pdf.p7m')
    ->setDestination('destination.pdf')
    ->save();
```

The {$openssl}, {$source}, {$destination} tokens are replace dinamically with the openssl executable, source and destination paths.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

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

Recently: every ~344 days

Total

7

Last Release

1305d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.1.2PHP ^7.0|^8.0|^9.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d89f2d44fb12225de2119994028ee69e36770bcf33c2b1ddf0d6672d28151b?d=identicon)[filippo.toso](/maintainers/filippo.toso)

---

Top Contributors

[![filippotoso](https://avatars.githubusercontent.com/u/26958813?v=4)](https://github.com/filippotoso "filippotoso (7 commits)")

### Embed Badge

![Health badge](/badges/filippo-toso-p7m-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/filippo-toso-p7m-extractor/health.svg)](https://phpackages.com/packages/filippo-toso-p7m-extractor)
```

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[spatie/typescript-transformer

This is my package typescript-transformer

3706.5M16](/packages/spatie-typescript-transformer)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[eclipxe/cfdiutils

PHP Common utilities for Mexican CFDI 3.2, 3.3 &amp; 4.0

141129.9k6](/packages/eclipxe-cfdiutils)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

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