PHPackages                             cyphera/keychain - 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. [Security](/categories/security)
4. /
5. cyphera/keychain

ActiveLibrary[Security](/categories/security)

cyphera/keychain
================

Pluggable key provider for the Cyphera encryption SDK

10[1 PRs](https://github.com/cyphera-labs/keychain-php/pulls)PHPCI passing

Since Apr 22Pushed 1mo agoCompare

[ Source](https://github.com/cyphera-labs/keychain-php)[ Packagist](https://packagist.org/packages/cyphera/keychain)[ RSS](/packages/cyphera-keychain/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

keychain-php
============

[](#keychain-php)

[![CI](https://github.com/cyphera-labs/keychain-php/actions/workflows/ci.yml/badge.svg)](https://github.com/cyphera-labs/keychain-php/actions/workflows/ci.yml)[![Security](https://github.com/cyphera-labs/keychain-php/actions/workflows/codeql.yml/badge.svg)](https://github.com/cyphera-labs/keychain-php/actions/workflows/codeql.yml)[![License](https://camo.githubusercontent.com/39a434c39c97856247fc55ebc90e8cc1cb9871558a37bf1bf83cbaca3be89d69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c7565)](LICENSE)

Pluggable key provider for the [Cyphera](https://cyphera.dev) encryption SDK (PHP).

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

[](#installation)

```
composer require cyphera/cyphera-keychain
```

Requires PHP 8.1 or later.

Providers
---------

[](#providers)

ProviderBackendStatus`MemoryProvider`In-memory storeStable`EnvProvider`Environment variablesStable`FileProvider`Local JSON fileStable`VaultProvider`HashiCorp Vault KV v2Stable`AwsKmsProvider`AWS KMSStub`GcpKmsProvider`GCP Cloud KMSStub`AzureKvProvider`Azure Key VaultStubQuick Start
-----------

[](#quick-start)

```
use Cyphera\Keychain\MemoryProvider;
use Cyphera\Keychain\KeyRecord;
use Cyphera\Keychain\Status;

$provider = new MemoryProvider(
    new KeyRecord(ref: 'my-key', version: 1, status: Status::ACTIVE, material: $keyBytes),
);

$record = $provider->resolve('my-key');
// $record->material contains the raw key bytes
```

### Vault Provider

[](#vault-provider)

```
use Cyphera\Keychain\VaultProvider;

$provider = new VaultProvider(
    url: 'http://127.0.0.1:8200',
    token: 'my-token',
    mount: 'secret',
);

$record = $provider->resolve('customer-primary');
```

### Bridge Resolver

[](#bridge-resolver)

The `Bridge` class provides a static resolver for config-driven key sources:

```
use Cyphera\Keychain\Bridge;

$material = Bridge::resolve('vault', [
    'ref' => 'customer-primary',
    'addr' => 'http://127.0.0.1:8200',
    'token' => 'my-token',
]);
```

Environment Variables
---------------------

[](#environment-variables)

- `VAULT_ADDR` -- Vault server URL (used by VaultProvider and Bridge)
- `VAULT_TOKEN` -- Vault authentication token

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

[](#development)

```
composer install
composer test
```

### Integration Tests

[](#integration-tests)

```
docker compose up -d
VAULT_ADDR=http://localhost:8200 VAULT_TOKEN=test-token composer test
```

License
-------

[](#license)

Apache-2.0. See [LICENSE](LICENSE).

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance61

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/87376207?v=4)[cyphera](/maintainers/cyphera)[@cyphera](https://github.com/cyphera)

---

Top Contributors

[![lgutschow](https://avatars.githubusercontent.com/u/16002067?v=4)](https://github.com/lgutschow "lgutschow (12 commits)")

---

Tags

aws-kmsazure-key-vaultcypheradata-protectionencryption-keysgcp-kmshashicorp-vaultkey-managementkmsphp

### Embed Badge

![Health badge](/badges/cyphera-keychain/health.svg)

```
[![Health](https://phpackages.com/badges/cyphera-keychain/health.svg)](https://phpackages.com/packages/cyphera-keychain)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M144](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k41](/packages/paragonie-ecc)

PHPackages © 2026

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