PHPackages                             setasign/setapdf-signer-addon-pkcs11 - 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-pkcs11

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

setasign/setapdf-signer-addon-pkcs11
====================================

A SetaPDF-Signer component signature add-on for accessing keys through the PKCS11 interface.

v1.1.1(3mo ago)1801↓82.4%MITPHPPHP &gt;=7.4 &lt;=8.5.99999

Since Feb 18Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/Setasign/SetaPDF-Signer-Addon-PKCS11)[ Packagist](https://packagist.org/packages/setasign/setapdf-signer-addon-pkcs11)[ Docs](https://github.com/Setasign/SetaPDF-Signer-Addon-PKCS11)[ RSS](/packages/setasign-setapdf-signer-addon-pkcs11/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

SetaPDF-Signer component module for PKCS11
==========================================

[](#setapdf-signer-component-module-for-pkcs11)

This package offers a module for the [SetaPDF-Signer](https://www.setasign.com/signer)component that allows you to use keys stored on a PKCS11 compatible device (e.g. HSM, USB Token) to digital sign PDF documents in pure PHP.

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

[](#requirements)

This module requires the [PKCS11](https://github.com/gamringer/php-pkcs11) PHP extension to be installed.

You also need to provide the path to the PKCS11 module of your device.

The package is developed and tested on PHP &gt;= 7.4 up to PHP 8.5 (PKCS11 PHP extension compiled from *master*; 2026-01-27). 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).

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

[](#installation)

Add following to your composer.json:

```
{
    "require": {
        "setasign/setapdf-signer-addon-pkcs11": "^1.1"
    },
    "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).

Usage
-----

[](#usage)

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

### 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. Internally it holds an own instance of the [PAdES signature module](https://manuals.setasign.com/setapdf-signer-manual/signature-modules/pades/)and offers all relevant proxy methods.

The only arguments you need to pass to the `Module` instance is a `\Pkcs11\Key` instance of the private key and the related X509 certificate.

The default padding schema for signatures using RSA keys is RSASSA-PKCS1-v1\_5. To use RSASSA-PSS just call `$module->setPssPadding();`.

A simple complete signature process would look like this:

```
