Download the PHP package marzsv/sv-dte-signer without Composer

On this page you can find all versions of the php package marzsv/sv-dte-signer. 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 sv-dte-signer

DTE Signer PHP SDK

PHP Version

A PHP SDK for signing and verifying Documentos Tributarios Electrónicos (DTE) for El Salvador using JWS RS512 digital signatures.

Project Status

✅ Production Ready - All core features implemented and tested ✅ MH Certificate Support - Full support for Ministerio de Hacienda certificate format ✅ Standards Compliant - Follows El Salvador DTE specifications ✅ Working Examples - Ready-to-run examples with test certificates ✅ Test Coverage - 37 tests, 90+ assertions, 100% pass rate 🔒 Security - Secure memory handling and input validation

Features

Quick Test Setup

For Testing and Development

  1. Clone and install:

  2. Generate test certificates:

  3. Run signing example:

  4. Run verification example:

  5. Run all tests:

For Production Use

Install via Composer:

Requirements

Quick Start

Basic Usage

Using JSON Files

Custom Certificate Directory

DTE Verification

The SDK also provides functionality to verify signed DTEs and extract their original content.

Basic Verification

Extract Payload Without Verification

Custom Certificate Directory for Verification

Certificate Setup

  1. Certificate Format: Certificates must be XML files with the following structure:

  2. File Naming: Certificate files must be named {NIT}.crt (e.g., 12345678901234.crt)

  3. Directory: Place certificates in the certificates/ directory or specify a custom path

API Reference

DteSigner Class

Constructor

Parameters:

sign()

Parameters:

Returns:

DteVerifier Class

Constructor

Parameters:

verify()

Parameters:

Returns:

extractPayload()

Parameters:

Returns:

⚠️ Warning: This method does not verify the signature. Use only when signature verification is not required.

Request Format

Error Codes

Code Description
COD_803 Validation error
COD_812 Certificate not found
COD_813 Invalid certificate
COD_814 Password mismatch
COD_815 Signing error
COD_816 JSON encoding error
COD_820 Verification error
COD_500 Unexpected error

Example Response

Successful Signing Response

JWS Token Structure

The signed JWS token follows the standard format: header.payload.signature

Error Response Example

Successful Verification Response

Verification Error Response

Examples

See the examples/ directory for working examples:

Running Examples

Prerequisites: Make sure you have generated test certificates first:

Then run any example:

Expected output: Examples will demonstrate signing, verification, and error handling with detailed output showing the complete process.

Testing

Test Results

✅ 37 tests | ✅ 90+ assertions | ✅ 100% pass rate | ⚡ <100ms execution time

Run the test suite:

Run with coverage:

Run static analysis:

Run all checks (tests + analysis):

Test Coverage

Security Considerations

Production Readiness

✅ Ready for Production

🔧 Production Setup Checklist

📋 Dependencies

Development

Project Structure

Code Style

This project follows PSR-12 coding standards and uses:

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes following PSR-12
  4. Add tests for new functionality
  5. Submit a pull request

License

MIT License. See LICENSE file for details.

Support

For issues and questions:

Disclaimer

This SDK implements the complete DTE signing specification and is production-ready from a technical standpoint. However:

For production deployment, review all security considerations and follow the production setup checklist above.


All versions of sv-dte-signer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-libxml Version *
ext-openssl Version *
firebase/php-jwt Version ^6.11
psr/log Version ^3.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 marzsv/sv-dte-signer contains the following files

Loading the files please wait ...