{"id":33984280,"url":"https://github.com/feimx/csd-converter","last_synced_at":"2026-05-29T22:33:34.945Z","repository":{"id":56982054,"uuid":"143778594","full_name":"feimx/csd-converter","owner":"feimx","description":"This package allow convert CSD (cer and key files) to pem files","archived":false,"fork":false,"pushed_at":"2018-08-08T07:00:52.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-14T16:48:28.902Z","etag":null,"topics":["cfdi33","csd","electronica","facturacion","mexico","sat"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feimx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-06T20:17:48.000Z","updated_at":"2018-08-29T06:03:55.000Z","dependencies_parsed_at":"2022-08-21T11:20:34.559Z","dependency_job_id":null,"html_url":"https://github.com/feimx/csd-converter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/feimx/csd-converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feimx%2Fcsd-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feimx%2Fcsd-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feimx%2Fcsd-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feimx%2Fcsd-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feimx","download_url":"https://codeload.github.com/feimx/csd-converter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feimx%2Fcsd-converter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33673628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfdi33","csd","electronica","facturacion","mexico","sat"],"created_at":"2025-12-13T04:27:32.928Z","updated_at":"2026-05-29T22:33:34.928Z","avatar_url":"https://github.com/feimx.png","language":"PHP","funding_links":["https://www.patreon.com/jorge_andrade"],"categories":[],"sub_categories":[],"readme":"# Convert pem required files for CFDI\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/feimx/csd_converter.svg?style=flat-square)](https://packagist.org/packages/feimx/csd_converter)\n[![Build Status](https://img.shields.io/travis/feimx/csd_converter/master.svg?style=flat-square)](https://travis-ci.org/feimx/csd_converter)\n[![Quality Score](https://img.shields.io/scrutinizer/g/feimx/csd_converter.svg?style=flat-square)](https://scrutinizer-ci.com/g/feimx/csd_converter)\n[![Total Downloads](https://img.shields.io/packagist/dt/feimx/csd_converter.svg?style=flat-square)](https://packagist.org/packages/feimx/csd_converter)\n\nThe `feimx/csd_converter` package provide a simple way for create .pem files for your CSD's.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require feimx/csd_converter\n```\n\n## Usage\n\nFirt need create a new instance of `CsdConverter`:\n\n``` php\n$converter = new FeiMx\\Csd\\CsdConverter();\necho $converter-\u003eserial_number();\n```\n\nThats all, now you can access the cer info and save the news files to given path\n\n``` php\necho $converter-\u003eserial_number;\necho $converter-\u003etax_id;\necho $converter-\u003evalid_from; // instance of Carbon\necho $converter-\u003evalid_to; // instance of Carbon\necho $converter-\u003egetStatus();\n```\n\n`valid_from` and `valid_to` are instances of Carbon, so you can modify and format the dates:\n\n``` php\necho $converter-\u003evalid_from-\u003eformat('d/m/Y h:i a');\necho $converter-\u003evalid_to-\u003eformat('d/m/Y h:i a');\n```\n\n`getStatus()` returns a expired, valid or invalid status:\n\n``` php\nif($converter-\u003egetStatus() === CsdConverter::VALID){}\nif($converter-\u003egetStatus() === CsdConverter::INVALID){}\nif($converter-\u003egetStatus() === CsdConverter::EXPIRED){}\n\n```\n\nYou can verify if the files are a valid CSD:\n\n``` php\nvar_dump($converter-\u003eisValidCsd()); // true or false\n```\n\nNow you can save the created files to a given path and assigne a optional filename:\n\n``` php\n$path = __DIR__.'/temp/';\n$filename = 'VALIDCSD';\n$converter-\u003esave($path, $filename);\n//this create 4 files:\n//__DIR__.'/temp/VALIDCSD.cer'\n//__DIR__.'/temp/VALIDCSD.cer.pem'\n//__DIR__.'/temp/VALIDCSD.key'\n//__DIR__.'/temp/VALIDCSD.key.pem'\n```\n\nAnd last, but not less important, you can encryp the converted key into des3:\n\n``` php\n$file = __DIR__.'/temp/VALIDCSD.key.pem';\n$password = 'secret';\n$converter-\u003eencryptKey($file, $password);\n//__DIR__.'/temp/VALIDCSD.enc.key'\n```\n\n_Note:_ This is very useful with third party provider such as Finkok for stamp the CFDI\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email yorch@feimexico.com.mx instead of using the issue tracker.\n\n## Credits\n\n- [Jorge Andrade](https://github.com/Yorchi)\n- [All Contributors](../../contributors)\n\n## Support us\n\nFEI 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).\n\nDoes your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/jorge_andrade). \nAll pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeimx%2Fcsd-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeimx%2Fcsd-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeimx%2Fcsd-converter/lists"}