PHPackages                             setasign/setapdf-signer-addon-google-cloud-kms - 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-google-cloud-kms

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

setasign/setapdf-signer-addon-google-cloud-kms
==============================================

A SetaPDF-Signer component signature module for the Google Cloud Key Management Service.

v1.1.2(3mo ago)214.9k↓28.6%[1 issues](https://github.com/Setasign/SetaPDF-Signer-Addon-Google-Cloud-KMS/issues)MITPHPPHP &gt;=7.2 &lt;=8.4.99999CI failing

Since Feb 2Pushed 1mo ago2 watchersCompare

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

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

SetaPDF-Signer component module for the Google Cloud KMS.
=========================================================

[](#setapdf-signer-component-module-for-the-google-cloud-kms)

This package offers a module for the [SetaPDF-Signer](https://www.setasign.com/signer) component that allow you to use the [Google Cloud Key Management Service](https://cloud.google.com/kms/docs) to **digital sign PDF documents in pure PHP**.

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

[](#requirements)

This package uses the official [Google Cloud KMS Client Libraries](https://cloud.google.com/kms/docs/reference/libraries)to communicate with the KMS. You need appropriate credentials.

You also need an X.509 certificates related to your stored keys. To create a self-signed certificate for testing purpose or to create a CSR for the certificate authority of your choice, you can use a tool we prepared [here](https://github.com/Setasign/Cloud-KMS-CSR).

The package is developed and tested on PHP &gt;= 7.2 up to PHP 8.4. 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-google-cloud-kms": "^1.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.

**Follow the [instructions to authentification](https://cloud.google.com/kms/docs/reference/libraries#setting_up_authentication) on Google Cloud KMS.**

Usage
-----

[](#usage)

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

### 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 5 arguments:

- `$projectId` - Your project id
- `$locationId` - Your location id
- `$keyRingId` - Your key Ring id
- `$keyId` - Your key id
- `$versionId` - Your version id
- `$kmsClient` - optional; can be used for e.g. authentification through code

A simple complete signature process would look like this:

```
use setasign\SetaPDF\Signer\Module\GoogleCloudKMS\Module;
use setasign\SetaPDF2\Core\Document;
use setasign\SetaPDF2\Core\Writer\FileWriter;
use setasign\SetaPDF2\Signer\Signer;

$googleCloudKmsModule = new Module(
    $projectId,
    $locationId,
    $keyRingId,
    $keyId,
    $versionId
);

$cert = file_get_contents('your-cert.crt');
$googleCloudKmsModule->setCertificate($cert);
$googleCloudKmsModule->setDigest($digest);

// 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);
$signer->sign($googleCloudKmsModule);
```

Make sure that you pass the same `$digest` value as configured for the key in the KMS.

License
-------

[](#license)

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

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance75

Regular maintenance activity

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

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 ~605 days

Total

4

Last Release

108d ago

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

v1.1.1PHP &gt;=7.1

v1.1.2PHP &gt;=7.2 &lt;=8.4.99999

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

google-cloud-kmspdfphpsetapdfsetapdf-signer

### Embed Badge

![Health badge](/badges/setasign-setapdf-signer-addon-google-cloud-kms/health.svg)

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[setasign/tfpdf

This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.

426.1M30](/packages/setasign-tfpdf)

PHPackages © 2026

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