PHPackages                             feimx/csd-converter - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. feimx/csd-converter

ActiveLibrary[File &amp; Storage](/categories/file-storage)

feimx/csd-converter
===================

This package allow you to convert csd to required pem files

1.1(7y ago)1288MITPHPPHP ^7.1

Since Aug 7Pushed 7y ago2 watchersCompare

[ Source](https://github.com/feimx/csd-converter)[ Packagist](https://packagist.org/packages/feimx/csd-converter)[ Docs](https://github.com/feimx/csd-converter)[ RSS](/packages/feimx-csd-converter/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Convert pem required files for CFDI
===================================

[](#convert-pem-required-files-for-cfdi)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8d8acc40234d3bea2d4a87493ca89428d206e69e86c3ac9c4423a642005c92fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6665696d782f6373645f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/feimx/csd_converter)[![Build Status](https://camo.githubusercontent.com/b0c155a540e0ccda0bc6dd59ce2dbb3016a50d3ff70b57e0989f2be5ab520669/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6665696d782f6373645f636f6e7665727465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/feimx/csd_converter)[![Quality Score](https://camo.githubusercontent.com/95eba7def5308674289a980ca22edd627df531a056ab47d21d4eefbcf5024a85/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6665696d782f6373645f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/feimx/csd_converter)[![Total Downloads](https://camo.githubusercontent.com/d1932f2e12080dacf9025384d20e8d9f827109a31ad285dd450c358e15ac5b2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6665696d782f6373645f636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/feimx/csd_converter)

The `feimx/csd_converter` package provide a simple way for create .pem files for your CSD's.

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

[](#installation)

You can install the package via composer:

```
composer require feimx/csd_converter
```

Usage
-----

[](#usage)

Firt need create a new instance of `CsdConverter`:

```
$converter = new FeiMx\Csd\CsdConverter();
echo $converter->serial_number();
```

Thats all, now you can access the cer info and save the news files to given path

```
echo $converter->serial_number;
echo $converter->tax_id;
echo $converter->valid_from; // instance of Carbon
echo $converter->valid_to; // instance of Carbon
echo $converter->getStatus();
```

`valid_from` and `valid_to` are instances of Carbon, so you can modify and format the dates:

```
echo $converter->valid_from->format('d/m/Y h:i a');
echo $converter->valid_to->format('d/m/Y h:i a');
```

`getStatus()` returns a expired, valid or invalid status:

```
if($converter->getStatus() === CsdConverter::VALID){}
if($converter->getStatus() === CsdConverter::INVALID){}
if($converter->getStatus() === CsdConverter::EXPIRED){}
```

You can verify if the files are a valid CSD:

```
var_dump($converter->isValidCsd()); // true or false
```

Now you can save the created files to a given path and assigne a optional filename:

```
$path = __DIR__.'/temp/';
$filename = 'VALIDCSD';
$converter->save($path, $filename);
//this create 4 files:
//__DIR__.'/temp/VALIDCSD.cer'
//__DIR__.'/temp/VALIDCSD.cer.pem'
//__DIR__.'/temp/VALIDCSD.key'
//__DIR__.'/temp/VALIDCSD.key.pem'
```

And last, but not less important, you can encryp the converted key into des3:

```
$file = __DIR__.'/temp/VALIDCSD.key.pem';
$password = 'secret';
$converter->encryptKey($file, $password);
//__DIR__.'/temp/VALIDCSD.enc.key'
```

*Note:* This is very useful with third party provider such as Finkok for stamp the CFDI

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jorge Andrade](https://github.com/Yorchi)
- [All Contributors](../../contributors)

Support us
----------

[](#support-us)

FEI is a Digital Invoicing startup based in Yucatán, México. You'll find an overview of all our open source projects [on our website](https://fei.com.mx/opensource).

Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/jorge_andrade). All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Total

2

Last Release

2835d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d0f7ef298a8212f962af789337d790ba61cf2d849609c66618ec86ad2422bb7?d=identicon)[Yorchi](/maintainers/Yorchi)

---

Top Contributors

[![Yorchi](https://avatars.githubusercontent.com/u/4969895?v=4)](https://github.com/Yorchi "Yorchi (5 commits)")

---

Tags

cfdi33csdelectronicafacturacionmexicosatfacturacion-electronicacfdimexicofeimxcsd-converter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/feimx-csd-converter/health.svg)

```
[![Health](https://phpackages.com/badges/feimx-csd-converter/health.svg)](https://phpackages.com/packages/feimx-csd-converter)
```

###  Alternatives

[eclipxe/cfdiutils

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

141129.9k6](/packages/eclipxe-cfdiutils)[phpcfdi/cfdi-sat-scraper

Web Scraping para extraer facturas electrónicas desde la página del SAT

9018.0k](/packages/phpcfdi-cfdi-sat-scraper)[phpcfdi/cfditopdf

Create a generic PDF file from a CFDI 3.3 &amp; 4.0 (CLI included)

4144.3k4](/packages/phpcfdi-cfditopdf)[codebar-ag/laravel-flysystem-cloudinary

Cloudinary Flysystem v1 integration with Laravel

1224.9k2](/packages/codebar-ag-laravel-flysystem-cloudinary)[phpcfdi/cfdi-to-json

Convert CFDI to JSON

3120.0k2](/packages/phpcfdi-cfdi-to-json)[facturapi/facturapi-php

Facturapi's PHP client library

1543.5k](/packages/facturapi-facturapi-php)

PHPackages © 2026

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