Download the PHP package selective/xmldsig without Composer
On this page you can find all versions of the php package selective/xmldsig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download selective/xmldsig
More information about selective/xmldsig
Files in selective/xmldsig
Package xmldsig
Short Description Sign XML Documents with Digital Signatures
License MIT
Homepage https://github.com/selective-php/xmldsig
Rated 5.00 based on 1 reviews
Informations about the package xmldsig
XMLDSIG for PHP
Features
- Sign XML Documents with Digital Signatures (XMLDSIG)
- Verify the Digital Signatures of XML Documents
- ECDSA (SHA256) signature
Requirements
- PHP 8.1+
- The openssl extension
- A X.509 digital certificate
Installation
Usage
Signing an XML Document with a digital signature
Input file: example.xml
Load and add the private key to the PrivateKeyStore
:
Define the digest method: sha1, sha224, sha256, sha384, sha512
Create a CryptoSigner
instance:
Signing:
Output:
Signing only specific part of an XML document
Example:
Signing an XML Document with ECDSA SHA256
The Elliptic Curve Digital Signature Algorithm (ECDSA) is the elliptic curve analogue of the Digital Signature Algorithm (DSA).
It is compatible with OpenSSL and uses elegant math such as Jacobian Coordinates to speed up the ECDSA on pure PHP.
Requirements
- The GMP extension must be installed and enabled.
To install the package with Composer, run:
Example
Note, you can sign an XML signature using ECDSA. It's not supported to use ECDSA for the digest.
You can find a fully working example in the XmlEcdsaTest test class.
Verify the Digital Signatures of XML Documents
Load the public key(s):
Create a CryptoVerifier
instance:
Verifying:
Online XML Digital Signature Verifier
Try these excellent online tools to verify XML signatures:
Similar libraries
License
The MIT License (MIT). Please see License File for more information.
All versions of xmldsig with dependencies
ext-dom Version *
ext-openssl Version *