PHPackages                             thihaeung/keylibrary - 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. thihaeung/keylibrary

ActiveLibrary

thihaeung/keylibrary
====================

keylibrary

1.0(2y ago)010MITPHPPHP ^8.2

Since Apr 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Morrowga/keylibrary)[ Packagist](https://packagist.org/packages/thihaeung/keylibrary)[ RSS](/packages/thihaeung-keylibrary/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![RSA Logo](https://camo.githubusercontent.com/18f984ce0451b9e88107c2441b0ea18ea088423f482bdc8205867e1fb39afb27/68747470733a2f2f63646e2e70726f707269766163792e636f6d2f73746f726167652f696d616765732f70726f707269766163792f323032312f30322f7273612d6b6579736a70672d636f6e74656e745f696d6167652d64656661756c742e706e67)](https://camo.githubusercontent.com/18f984ce0451b9e88107c2441b0ea18ea088423f482bdc8205867e1fb39afb27/68747470733a2f2f63646e2e70726f707269766163792e636f6d2f73746f726167652f696d616765732f70726f707269766163792f323032312f30322f7273612d6b6579736a70672d636f6e74656e745f696d6167652d64656661756c742e706e67)

Description
-----------

[](#description)

In this package, you can easily store the rsa public &amp; private key on your desire model with collection or wihtout collection: Features include, store, get, delete. I will show you with the examples.See below,

Setup
-----

[](#setup)

Install package by command

```
composer require thihaeung/keylibrary

```

Publishing key table &amp; Config

```
  php artisan vendor:publish --provider="Thihaeung\KeyLibrary\Providers\KeyServiceProvider" --tag=key-library-config --tag=key-migrations

```

Migrating table

```
php artisan migrate

```

Usage
-----

[](#usage)

Public Key Extension

- crt,pem,pub,key

Private Key Extension

- crt,pem,key

Use key trait in your desire model

```
use Thihaeung\KeyLibrary\Traits\HasKeyCollection;

use HasKeyCollection;

```

Store Key with collection or without collection. Note - if you don't add collection, the default collection will be 'keys' folder and key file extension will .pem .

- Without Collection

```
$model->addToKeyCollection($publicKey, $privateKey);

```

- With Collection

```
$model->addToKeyCollection($publicKey, $privateKey, $collectionName);

```

Fetching Key String and Key Path

- get Both Keys without Collection.

```
$model->getKeys();

```

- get Both Keys With Collection

```
$model->getKeys($collectionName);

```

- get only Public Key without Collection

```
$model->getPublicKey();

```

- get only Public Key with Collection

```
$model->getPublicKey($collectionName);

```

- get only Private Key without Collection

```
$model->getPrivateKey();

```

- get only Private Key with Collection

```
$model->getPrivateKey($collectionName);

```

- get Keys from all collections

```
$model->getAllCollectionKeys();

```

Deleting Keys

- delete Keys without collection

```
$model->deleteKeyFromCollection();

```

- delete Keys with collection

```
$model->deleteKeyFromCollection($collectionName);

```

- Delete Collection Commands

```
php artisan key:delete-collection collectionName

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

760d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3c829d26b8a3ac911dcfe1f1b0446daa592b5d8d55f2ab2f4594bccd247d639?d=identicon)[Morrowga](/maintainers/Morrowga)

---

Top Contributors

[![Morrowga](https://avatars.githubusercontent.com/u/48879518?v=4)](https://github.com/Morrowga "Morrowga (19 commits)")

### Embed Badge

![Health badge](/badges/thihaeung-keylibrary/health.svg)

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

PHPackages © 2026

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