PHPackages                             keboola/key-generator - 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. keboola/key-generator

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

keboola/key-generator
=====================

Service Client provides easy way to get Keboola services URLs

1.0.0(1y ago)016.3k↓49.8%4MITPHPPHP &gt;=8.2CI failing

Since Apr 25Pushed 1w ago8 watchersCompare

[ Source](https://github.com/keboola/php-key-generator)[ Packagist](https://packagist.org/packages/keboola/key-generator)[ RSS](/packages/keboola-key-generator/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (1)Dependencies (5)Versions (28)Used By (4)

Key Generator
=============

[](#key-generator)

Generates RSA key pairs for Keboola services — currently used for Snowflake key-pair authentication of Connection workspaces (see [`keboola/staging-provider`](../staging-provider)).

Requires `ext-openssl`.

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

[](#installation)

```
composer require keboola/key-generator
```

Usage
-----

[](#usage)

```
use Keboola\KeyGenerator\PemKeyCertificateGenerator;

$generator = new PemKeyCertificateGenerator();

// Unencrypted private key
$pair = $generator->createPemKeyCertificate(null);

// Private key encrypted with a passphrase
$pair = $generator->createPemKeyCertificate('my-passphrase');

$pair->privateKey; // PEM-encoded 2048-bit RSA private key
$pair->publicKey;  // PEM-encoded public key
```

`createPemKeyCertificate()` returns a `PemKeyCertificatePair` with exactly two values — despite the name, **no certificate is returned**. Internally it also builds a certificate signing request from `CertificateSigningRequest::createDefault()` (hard-coded Keboola company details) and self-signs it, but that certificate is currently discarded. Exposing it would require changing the return type and making the CSR subject caller-supplied.

The generated key pair is not persisted anywhere; storing it is the caller's responsibility. `PemKeyCertificatePair::$privateKey` and the `$password` argument are marked `#[SensitiveParameter]` so they are redacted from stack traces.

Failures at any OpenSSL step throw a `RuntimeException`.

Development
-----------

[](#development)

Run everything through the library's Docker Compose service:

```
docker compose run --rm dev-key-generator composer install
docker compose run --rm dev-key-generator composer ci   # validate + phpcs + phpstan + tests
```

No environment variables are required.

License
-------

[](#license)

MIT licensed, see [LICENSE](./LICENSE) file.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance74

Regular maintenance activity

Popularity26

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% of commits — single point of failure

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

Unknown

Total

1

Last Release

479d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/101dbf2551a0709ddab522f97669f13a2c4cc2d0a1e8d009f3af6ba80accb1a9?d=identicon)[Keboola](/maintainers/Keboola)

---

Top Contributors

[![pepamartinec](https://avatars.githubusercontent.com/u/271753?v=4)](https://github.com/pepamartinec "pepamartinec (6 commits)")[![odinuv](https://avatars.githubusercontent.com/u/4319320?v=4)](https://github.com/odinuv "odinuv (4 commits)")[![ondrajodas](https://avatars.githubusercontent.com/u/12143866?v=4)](https://github.com/ondrajodas "ondrajodas (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/keboola-key-generator/health.svg)

```
[![Health](https://phpackages.com/badges/keboola-key-generator/health.svg)](https://phpackages.com/packages/keboola-key-generator)
```

###  Alternatives

[inpsyde/disable-comments

Entirely ditches comments as a WordPress feature.

1824.8k1](/packages/inpsyde-disable-comments)[vovayatsyuk/magento2-alsoviewed

Product recommendations and suggestions. People who viewed this item also viewed. People with similar interests also viewed.

316.0k](/packages/vovayatsyuk-magento2-alsoviewed)[frankmullenger/underconstruction

SilverStripe Under Construction Page Module

152.2k](/packages/frankmullenger-underconstruction)

PHPackages © 2026

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