Download the PHP package phpcfdi/credentials without Composer

On this page you can find all versions of the php package phpcfdi/credentials. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package credentials

phpcfdi/credentials

Source Code Packagist PHP Version Support Discord Latest Version Software License Build Status Reliability Maintainability Code Coverage Violations Total Downloads

Library to use eFirma (fiel) and CSD (sellos) from SAT

:us: The documentation of this project is in spanish as this is the natural language for intended audience.

:mexico: La documentación del proyecto está en español porque ese es el lenguaje principal de los usuarios.

Esta librería ha sido creada para poder trabajar con los archivos CSD y FIEL del SAT. De esta forma, se simplifica el proceso de firmar, verificar firma y obtener datos particulares del archivo de certificado así como de la llave pública.

Con esta librería no es necesario convertir los archivos generados por el SAT a otro formato, se pueden utilizar tal y como el SAT los entrega.

Instalación

Usa composer

Ejemplo básico de uso

Acerca de los archivos de certificado y llave privada

Los archivos de certificado vienen en formato X.509 DER y los de llave privada en formato PKCS#8 DER. Ambos formatos no se pueden interpretar directamente en PHP (con ext-openssl), sin embargo, sí lo pueden hacer en el formato compatible PEM.

Esta librería tiene la capacidad de hacer esta conversión internamente (sin openssl), pues solo consiste en codificar a base64, en renglones de 64 caracteres y con cabeceras específicas para certificado y llave privada.

De esta forma, para usar el certificado AAA010101AAA.cer o la llave privada AAA010101AAA.key provistos por el SAT, no es necesario convertirlos con openssl y la librería los detectará correctamente.

Crear un objeto de certificado Certificate

El objeto Certificate no se creará si contiene datos no válidos.

El SAT entrega el certificado en formato X.509 DER, por lo que internamente se puede convertir a X.509 PEM. También es frecuente usar el formato X.509 DER base64, por ejemplo, en el atributo Comprobante@Certificado o en las firmas XML, por este motivo, los formatos soportados para crear un objeto Certificate son X.509 DER, X.509 DER base64 y X.509 PEM.

Crear un objeto de llave privada PrivateKey

El objeto PrivateKey no se creará si contiene datos no válidos.

En SAT entrega la llave en formato PKCS#8 DER, por lo que internamente se puede convertir a PKCS#8 PEM (con la misma contraseña) y usarla desde PHP.

Una vez abierta la llave también se puede cambiar o eliminar la contraseña, creando así un nuevo objeto PrivateKey.

Notas de tratamiento de archivos DER:

Para entender más de los formatos de llaves privadas se puede consultar la siguiente liga: https://github.com/kjur/jsrsasign/wiki/Tutorial-for-PKCS5-and-PKCS8-PEM-private-key-formats-differences

Leer y exportar archivos PFX

Esta librería soporta obtener el objeto Credential desde un archivo PFX (PKCS #12) y vicerversa.

Para exportar el archivo PFX:

Para leer el archivo PFX y obtener un objeto Credential:

Compatibilidad

Esta librería se mantendrá compatible con al menos la versión con soporte activo de PHP más reciente.

También utilizamos Versionado Semántico 2.0.0 por lo que puedes usar esta librería sin temor a romper tu aplicación.

Contribuciones

Las contribuciones con bienvenidas. Por favor lee CONTRIBUTING para más detalles y recuerda revisar el archivo de tareas pendientes TODO y el archivo CHANGELOG.

Copyright and License

The phpcfdi/credentials library is copyright © PhpCfdi and licensed for use under the MIT License (MIT). Please see LICENSE for more information.


All versions of credentials with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-mbstring Version *
ext-openssl Version *
eclipxe/enum Version ^0.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpcfdi/credentials contains the following files

Loading the files please wait ....