Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Xmlseclibs Laravel Package

rnijveld/xmlseclibs

Fork of xmlseclibs for working with XML Digital Signatures and XML Encryption in PHP. Provides tools to sign, verify, encrypt, and decrypt XML documents (XMLDSig/XMLENC) commonly used in SAML, SOAP, and other security-focused XML workflows.

View on GitHub
Deep Wiki
Context7

A PHP library for XML Security (unofficial)

Frequently asked questions about Xmlseclibs
How do I integrate xmlseclibs into a Laravel project for XML digital signatures?
Use Laravel’s service container to bind the library. Register a service provider to initialize XMLSecurityLibs with `XMLSecurityLibs::XMLSEC_DOM`, then inject the instance into controllers or jobs. Example: `App::make('xmlsec')->signNode($domNode, $privateKey)`. Ensure `ext-dom` and `ext-xml` are enabled in your PHP environment.
Will this package work with Laravel’s built-in XML tools like SimpleXML?
No, xmlseclibs manipulates DOM directly, which may conflict with Laravel’s SimpleXML. Use the library’s DOM methods exclusively or wrap it in a service to isolate DOM operations. Avoid mixing both libraries for the same XML document to prevent unexpected behavior.
What Laravel versions does xmlseclibs support, and what PHP version is required?
The package requires PHP 7.4+ and is compatible with Laravel 8.x and 9.x. For Laravel 10+, verify compatibility with PHP 8.2+ as the library may not support newer PHP features. Check your Laravel version’s PHP requirements before installation.
Is xmlseclibs actively maintained? Should I use it for production?
The package is unmaintained with no recent commits. For production, consider forking it or evaluating alternatives like `spomky-labs/xml-securities`. If you proceed, monitor PHP/ext-libxml updates for compatibility issues and plan for potential breaking changes.
How do I handle private keys securely in Laravel with this library?
Store private keys in Laravel Vault, AWS KMS, or environment variables (encrypted). Avoid hardcoding keys. Use Laravel’s `config/filesystems` to manage key files securely, and restrict file permissions to prevent unauthorized access.
Can I use xmlseclibs for encrypting SOAP responses in Laravel?
Yes, xmlseclibs supports XML encryption (XMLENC) for SOAP responses. Load your SOAP XML into a DOM object, encrypt the relevant nodes using `$xmlSec->encryptNode()`, and return the encrypted XML. Ensure your SOAP client can handle encrypted payloads.
What are the performance implications of using xmlseclibs for large XML files?
XML signing/encryption can introduce latency, especially for large files. Benchmark operations in your staging environment to assess impact. Optimize by caching keys or processing smaller XML chunks if possible. Avoid blocking requests during heavy operations.
Are there Laravel-specific examples or tutorials for xmlseclibs?
The package lacks Laravel-specific documentation. Start with the [GitHub README](https://github.com/rnijveld/xmlseclibs) for core usage, then adapt examples to Laravel’s service container. Community-driven guides or internal runbooks may be needed for complex workflows.
How do I test XML security operations in Laravel’s testing environment?
Use Laravel’s `XmlServiceProvider` to bind a mock or test instance of `XMLSecurityLibs`. Test signing/verification with predefined XML snippets and keys. For integration tests, use `Http::fake()` to simulate SOAP/XML endpoints and assert responses.
What alternatives to xmlseclibs exist for XML security in Laravel?
Consider `spomky-labs/xml-securities` (actively maintained), `phpseclib` (for non-XML encryption), or Laravel’s native `openssl_*` functions for simpler use cases. Evaluate based on maintenance, Laravel integration, and feature support (e.g., SAML, XAdES).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor