PHPackages                             kduma/signed-document - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kduma/signed-document

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

kduma/signed-document
=====================

XML Document Signer

v0.3.0(5y ago)0101[1 issues](https://github.com/kduma-OSS/PHP-signed-document/issues)MITPHPPHP ^7.4|^8.0CI failing

Since Sep 16Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/kduma-OSS/PHP-signed-document)[ Packagist](https://packagist.org/packages/kduma/signed-document)[ Docs](https://github.com/kduma-oss/signed-document)[ RSS](/packages/kduma-signed-document/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

PHP Signed Document Library
===========================

[](#php-signed-document-library)

[![Latest Version on Packagist](https://camo.githubusercontent.com/99501f44283a34d17d454552ce80e47c80abd9a07f727d8d1e9e997fa8efd3c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b64756d612f7369676e65642d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kduma/signed-document)[![Build Status](https://camo.githubusercontent.com/ae9af799d3a0f3407871af7fcb6bdd2a6565ad86cde0d98d25d8b8bd300a303c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b64756d612f7369676e65642d646f63756d656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/kduma/signed-document)[![Quality Score](https://camo.githubusercontent.com/ffa97dbc692eceab003546b7efaad68f05b7957e33697b2c6ac7545fb08ad77f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b64756d612d4f53532f5048502d7369676e65642d646f63756d656e742f2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/kduma/signed-document)[![Total Downloads](https://camo.githubusercontent.com/853ff71734c6ac14368a145d167f6b3e99376f18c2b0b38d2b5c94aae8be3cbc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b64756d612f7369676e65642d646f63756d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kduma/signed-document)

PHP implementation of digital document signing.

Check full documentation here: [opensource.duma.sh/libraries/deprecated/signed-document](https://opensource.duma.sh/libraries/deprecated/signed-document)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kduma/signed-document
```

Usage
-----

[](#usage)

### Creating and Signing documents

[](#creating-and-signing-documents)

```
$signer = new \Kduma\SignedDocument\DocumentSigner(
    \ParagonIE\Halite\KeyFactory::generateSignatureKeyPair()->getSecretKey()
);

$document_1 = \Kduma\SignedDocument\Document::make("Some Content", 'test-document');
$document_1->addSignature($signer->sign($document_1, 'ceo'));

$document_2 = \Kduma\SignedDocument\Document::make("Some  Other Content", 'other-document');
$document_2->addSignature($signer->sign($document_2, 'ceo'));

$collection = new \Kduma\SignedDocument\DocumentCollection();
$collection->addDocument($document_1);
$collection->addDocument($document_2);

echo $collection->getXml();
```

Sample Output:

```

    Some Content]]>
    09ef8a4aca1ed3faf0886351f54fd6469b60fee91f41ad27176b77cb6a287f4850cd89661cac0f02d3cdbc8821c9defb0d337c368583241f20d208d821977d09

    Some  Other Content]]>
    af8dcdcb2f2644edd633bf288df516c27fe25904e314cc71a9e26c7121376b10fff83615d4c6ac6df2f7512ac23efaa0cb55235c941b3c9653705741e7879808

```

### Verifying

[](#verifying)

```
$signer = new \Kduma\SignedDocument\DocumentValidator();

$collection = \Kduma\SignedDocument\DocumentCollection::fromXml('
