PHPackages                             setasign/setapdf-signer-addon-azure-keyvault - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. setasign/setapdf-signer-addon-azure-keyvault

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

setasign/setapdf-signer-addon-azure-keyvault
============================================

A SetaPDF-Signer component signature module for the Azure KeyVault.

v2.0.1(5mo ago)28.0k↓63.7%MITPHPPHP &gt;=7.2 &lt;=8.5.99999

Since Nov 20Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/Setasign/SetaPDF-Signer-Addon-Azure-KeyVault)[ Packagist](https://packagist.org/packages/setasign/setapdf-signer-addon-azure-keyvault)[ Docs](https://github.com/Setasign/SetaPDF-Signer-Addon-Azure-KeyVault)[ RSS](/packages/setasign-setapdf-signer-addon-azure-keyvault/feed)WikiDiscussions main Synced yesterday

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

SetaPDF-Signer component module for the Azure Key Vault.
========================================================

[](#setapdf-signer-component-module-for-the-azure-key-vault)

This package offers a module for the [SetaPDF-Signer](https://www.setasign.com/signer) component that allow you to use the [Azure Key Vault](https://azure.microsoft.com/services/key-vault/) by [Microsoft](https://www.microsoft.com) to **digital sign PDF documents in pure PHP**.

Requirements
------------

[](#requirements)

To use this package you need credentials for the Azure Key Vault Service.

This package is developed and tested on PHP &gt;= 7.2 up to PHP 8.5. Requirements of the [SetaPDF-Signer](https://www.setasign.com/signer)component can be found [here](https://manuals.setasign.com/setapdf-signer-manual/getting-started/#index-1).

We're using [PSR-17 (HTTP Factories)](https://www.php-fig.org/psr/psr-17/) and [PSR-18 (HTTP Client)](https://www.php-fig.org/psr/psr-18/)for the requests. So you'll need an implementation of these. We recommend using Guzzle:

```
    "require" : {
        "guzzlehttp/guzzle": "^7.0",
        "http-interop/http-factory-guzzle": "^1.0"
    }

```

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

[](#installation)

Add following to your composer.json:

```
{
    "require": {
        "setasign/setapdf-signer-addon-azure-keyvault": "^2.0"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://www.setasign.com/downloads/"
        }
    ]
}
```

and execute `composer update`. You need to define the `repository` to evaluate the dependency to the [SetaPDF-Signer](https://www.setasign.com/signer) component (see [here](https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md) for more details).

The Setasign repository requires authentication data: You can use your credentials of your account at [setasign.com](https://www.setasign.com) to which your licenses are assigned or use an access token which you can create in your personal [composer settings](https://www.setasign.com/my-setasign/composer-settings/#bearer-authentication)on setasign.com. See [here](https://getcomposer.org/doc/articles/authentication-for-private-packages.md#http-basic)for more options for authentication with composer.

### Without Composer

[](#without-composer)

It's recommend to use composer otherwise you have to resolve the depency tree manually. You will require:

- [SetaPDF-Signer component](https://www.setasign.com/signer)
- [PSR-7 interfaces](https://github.com/php-fig/http-message)
- [PSR-17 interfaces](https://github.com/php-fig/http-factory)
- [PSR-18 interfaces](https://github.com/php-fig/http-client)
- PSR-7 implementation like [Guzzle PSR-7](https://github.com/guzzle/psr7)
- PSR-17 implementation like [HTTP Factory for Guzzle](https://github.com/http-interop/http-factory-guzzle)
- PSR-18 implementation like [Guzzle](https://github.com/guzzle/guzzle)

Make sure, that the [SetaPDF-Signer component](https://www.setasign.com/signer)is [installed](https://manuals.setasign.com/setapdf-core-manual/installation/#index-2) and its [autoloader is registered](https://manuals.setasign.com/setapdf-core-manual/getting-started/#index-1) correctly.

Then simply require the `src/autoload.php` file or register this package in your own PSR-4 compatible autoload implementation:

```
$loader = new \Example\Psr4AutoloaderClass;
$loader->register();
$loader->addNamespace('setasign\SetaPDF\Signer\Module\AzureKeyVault', 'path/to/src/');
```

Usage
-----

[](#usage)

All classes in this package are located in the namespace `setasign\SetaPDF\Signer\Module\AzureKeyVault`.

### The `Module` class

[](#the-module-class)

This is the main signature module which can be used with the [SetaPDF-Signer](https://www.setasign.com/signer)component. Its constructor requires 6 arguments:

- `$vaultBaseUrl` The base url of your key vault.
- `$certificateName` The name of your key.
- `$certificateVersion` The version of your key.
- `$httpClient` PSR-18 HTTP Client implementation.
- `$requestFactory` PSR-17 HTTP Factory implementation.
- `$streamFactory` PSR-17 HTTP Factory implementation.

A simple complete signature process would look like this:

```
use setasign\SetaPDF2\Core\Document;
use setasign\SetaPDF2\Core\Writer\FileWriter;
use setasign\SetaPDF2\Signer\Signer;

$httpClient = new GuzzleHttp\Client([
    'http_errors' => false,
    //'verify' => './cacert.pem'
]);

$azureModule = new setasign\SetaPDF\Signer\Module\AzureKeyVault\Module(
    $vaultBaseUrl,
    $certificateName,
    $certificateVersion,
    $httpClient,
    new Http\Factory\Guzzle\RequestFactory(),
    new Http\Factory\Guzzle\StreamFactory()
);

$token = $azureModule->createTokenBySharedSecret($tenantId, $appClientId, $appClientSecret);
$azureModule->setAccessToken($token['accessToken']);

// the file to sign
$fileToSign = __DIR__ . '/Laboratory-Report.pdf';

// create a writer instance
$writer = new FileWriter('signed.pdf');
// create the document instance
$document = Document::loadByFilename($fileToSign, $writer);

// create the signer instance
$signer = new Signer($document);
$azureModule->setSignatureAlgorithm($alg);
$signer->sign($azureModule);
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance72

Regular maintenance activity

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~378 days

Recently: every ~472 days

Total

6

Last Release

158d ago

Major Versions

v1.2.0 → v2.0.02023-03-15

PHP version history (3 changes)v1.0.0PHP &gt;=7.0

v1.1.1PHP &gt;=7.1

v2.0.1PHP &gt;=7.2 &lt;=8.5.99999

### Community

Maintainers

![](https://www.gravatar.com/avatar/78b46f7020bdcd25e761812659988691e50aba9a25b2a48ea33f6137f2fc2536?d=identicon)[Setasign](/maintainers/Setasign)

---

Top Contributors

[![MaximilianKresse](https://avatars.githubusercontent.com/u/545671?v=4)](https://github.com/MaximilianKresse "MaximilianKresse (25 commits)")[![JanSlabon](https://avatars.githubusercontent.com/u/12390057?v=4)](https://github.com/JanSlabon "JanSlabon (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

azure-keyvaultdigital-signaturepdfphpsetapdfsetapdf-signersignature

### Embed Badge

![Health badge](/badges/setasign-setapdf-signer-addon-azure-keyvault/health.svg)

```
[![Health](https://phpackages.com/badges/setasign-setapdf-signer-addon-azure-keyvault/health.svg)](https://phpackages.com/packages/setasign-setapdf-signer-addon-azure-keyvault)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60216.0M85](/packages/mollie-mollie-api-php)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
