{"id":18765332,"url":"https://github.com/setasign/setapdf-signer-addon-google-cloud-kms","last_synced_at":"2026-01-23T12:38:51.753Z","repository":{"id":37979231,"uuid":"329350448","full_name":"Setasign/SetaPDF-Signer-Addon-Google-Cloud-KMS","owner":"Setasign","description":"A SetaPDF-Signer component signature module for the Google Cloud Key Management Service.","archived":false,"fork":false,"pushed_at":"2024-08-22T08:06:07.000Z","size":156,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T21:08:54.130Z","etag":null,"topics":["google-cloud-kms","pdf","php","setapdf","setapdf-signer"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Setasign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-13T15:29:05.000Z","updated_at":"2024-08-22T08:06:10.000Z","dependencies_parsed_at":"2024-03-06T14:49:02.291Z","dependency_job_id":null,"html_url":"https://github.com/Setasign/SetaPDF-Signer-Addon-Google-Cloud-KMS","commit_stats":{"total_commits":29,"total_committers":4,"mean_commits":7.25,"dds":0.6896551724137931,"last_synced_commit":"520ba00ca2b41c75cc96a0a6984e138170fb400d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-Signer-Addon-Google-Cloud-KMS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-Signer-Addon-Google-Cloud-KMS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-Signer-Addon-Google-Cloud-KMS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Setasign%2FSetaPDF-Signer-Addon-Google-Cloud-KMS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Setasign","download_url":"https://codeload.github.com/Setasign/SetaPDF-Signer-Addon-Google-Cloud-KMS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665746,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-cloud-kms","pdf","php","setapdf","setapdf-signer"],"created_at":"2024-11-07T18:33:35.335Z","updated_at":"2026-01-23T12:38:51.726Z","avatar_url":"https://github.com/Setasign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  SetaPDF-Signer component module for the Google Cloud KMS.\n\nThis package offers a module for the [SetaPDF-Signer](https://www.setasign.com/signer) component that allow you to use\nthe [Google Cloud Key Management Service](https://cloud.google.com/kms/docs) to **digital sign PDF documents in pure PHP**.\n\n## Requirements\n\nThis package uses the official\n[Google Cloud KMS Client Libraries](https://cloud.google.com/kms/docs/reference/libraries)\nto communicate with the KMS. You need appropriate credentials.\n\nYou also need an X.509 certificates related to your stored keys. To create a self-signed certificate for testing purpose\nor to create a CSR for the certificate authority of your choice, you can use a tool we prepared\n[here](https://github.com/Setasign/Cloud-KMS-CSR).\n\nThe package is developed and tested on PHP \u003e= 7.2 up to PHP 8.4. Requirements of the [SetaPDF-Signer](https://www.setasign.com/signer)\ncomponent can be found [here](https://manuals.setasign.com/setapdf-signer-manual/getting-started/#index-1).\n\n## Installation\nAdd following to your composer.json:\n\n```json\n{\n    \"require\": {\n        \"setasign/setapdf-signer-addon-google-cloud-kms\": \"^1.0\"\n    },\n    \"repositories\": [\n        {\n            \"type\": \"composer\",\n            \"url\": \"https://www.setasign.com/downloads/\"\n        }\n    ]\n}\n```\n\nand execute `composer update`. You need to define the `repository` to evaluate the dependency to the\n[SetaPDF-Signer](https://www.setasign.com/signer) component\n(see [here](https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md) for more details).\n\nThe Setasign repository requires authentication data: You can use your credentials\nof your account at [setasign.com](https://www.setasign.com) to which your licenses\nare assigned. You will be asked for this during a composer run. See\n[here](https://getcomposer.org/doc/articles/authentication-for-private-packages.md#http-basic)\nfor more options for authentication with composer.\n\n**Follow the [instructions to authentification](https://cloud.google.com/kms/docs/reference/libraries#setting_up_authentication) on Google Cloud KMS.**\n\n## Usage\n\nAll classes in this package are located in the namespace `setasign\\SetaPDF\\Signer\\Module\\GoogleCloudKMS`.\n\n### The `Module` class\n\nThis is the main signature module which can be used with the [SetaPDF-Signer](https://www.setasign.com/signer)\ncomponent. Its constructor requires 5 arguments:\n\n- `$projectId` -  Your project id\n- `$locationId` -  Your location id\n- `$keyRingId` -  Your key Ring id\n- `$keyId` -  Your key id\n- `$versionId` -  Your version id\n- `$kmsClient` - optional; can be used for e.g. authentification through code\n\nA simple complete signature process would look like this:\n\n```php\n$googleCloudKmsModule = new setasign\\SetaPDF\\Signer\\Module\\GoogleCloudKMS\\Module(\n    $projectId,\n    $locationId,\n    $keyRingId,\n    $keyId,\n    $versionId\n);\n\n$cert = file_get_contents('your-cert.crt');\n$googleCloudKmsModule-\u003esetCertificate($cert);\n$googleCloudKmsModule-\u003esetDigest($digest);\n\n// the file to sign\n$fileToSign = __DIR__ . '/Laboratory-Report.pdf';\n\n// create a writer instance\n$writer = new SetaPDF_Core_Writer_File('signed.pdf');\n// create the document instance\n$document = SetaPDF_Core_Document::loadByFilename($fileToSign, $writer);\n\n// create the signer instance\n$signer = new SetaPDF_Signer($document);\n$signer-\u003esign($googleCloudKmsModule);\n```\n\nMake sure that you pass the same `$digest` value as configured for the key in the KMS. \n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fsetapdf-signer-addon-google-cloud-kms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsetasign%2Fsetapdf-signer-addon-google-cloud-kms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetasign%2Fsetapdf-signer-addon-google-cloud-kms/lists"}