PHPackages                             secretary/core - 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. secretary/core

ActiveLibrary[Security](/categories/security)

secretary/core
==============

Secrets Manager for PHP

4.3.0(3mo ago)294.1k↓35%17MITPHPPHP ^8.2

Since Apr 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/secretary/php-core)[ Packagist](https://packagist.org/packages/secretary/core)[ RSS](/packages/secretary-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (43)Used By (7)

Secretary - Secrets Manager for PHP
===================================

[](#secretary---secrets-manager-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/550ef1bca49eee76eaacf7ffa22050bda338eafc9dfdbd0f9c2ab2d6e7f46210/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f636f72652f76657273696f6e)](https://packagist.org/packages/secretary/core) [![Total Downloads](https://camo.githubusercontent.com/04be21449b93e2904e86684102f31e82d5d1a07e1c3897465dcd0c0cbb117bd0/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f636f72652f646f776e6c6f616473)](https://packagist.org/packages/secretary/core)

Secrets are an important aspect of most applications you can build. How you store them, and keep them "secret" is a challenge. Luckily, there are tools you can use to keep them all safe.

Secretary is a tool to integrate your PHP application with these tools.

Table of Contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
2. [Api Documentation](#api-documentation)
    1. [Secretary\\Manager](#manager-class)
        1. [Initializing](#manager-constructor)
        2. [getSecret](#manager-getSecret)
        3. [putSecret](#manager-putSecret)
        4. [deleteSecret](#manager-deleteSecret)
        5. [getAdapter](#manager-getAdapter)
    2. [Secretary\\Secret](#secret-class)
        1. [getKey](#secret-getKey)
        2. [getValue](#secret-getValue)

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

[](#installation)

```
$ composer req secretary/core
```

##### Choose the version you need

[](#choose-the-version-you-need)

Version (X.Y.Z)PHPSymfonyComment`3.*``>= 8.1.0``7.0`**Current version**`2.*``>= 8.1.0``5.4, 6.0`Previous version`1.*``>= 7.4.0``5.3`Previous versionBy itself, the core is useless. You will also need to add at least one adapter:

Storage EngineBadges[AWS Secrets Manager](https://github.com/secretary/php-aws-secrets-manager-adapter)[![Latest Stable Version](https://camo.githubusercontent.com/2968360e5bc6e59647337a148a94367d3ef0968429730eaec278fdc5f38167e2/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6177732d736563726574732d6d616e616765722d616461707465722f76657273696f6e)](https://packagist.org/packages/secretary/aws-secrets-manager-adapter) [![Total Downloads](https://camo.githubusercontent.com/73990500ad07bdd7905fcb6afc099cbca8337bf90ea61c98ec1cf1d2b020a699/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6177732d736563726574732d6d616e616765722d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/secretary/aws-secrets-manager-adapter)[HashiCorp Vault](https://github.com/secretary/php-hashicorp-vault-adapter)[![Latest Stable Version](https://camo.githubusercontent.com/6ccd30188b9ce2242742814d723e7382744e56067fdc783288a9811bf8116b61/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6861736869636f72702d7661756c742d616461707465722f76657273696f6e)](https://packagist.org/packages/secretary/hashicorp-vault-adapter) [![Total Downloads](https://camo.githubusercontent.com/8c541ed34b4fbcefe77ef97c765432312ff23e8e3e5430780f4713eab8575fc7/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6861736869636f72702d7661756c742d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/secretary/hashicorp-vault-adapter)[JSON File](https://github.com/secretary/php-json-file-adapter)[![Latest Stable Version](https://camo.githubusercontent.com/53639527179fad1472e5bdffaa75eab874e5494d2c12f64a5402912732d6a7e0/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6c6f63616c2d6a736f6e2d66696c652d616461707465722f76657273696f6e)](https://packagist.org/packages/secretary/local-json-file-adapter) [![Total Downloads](https://camo.githubusercontent.com/c2c0dec24cb0b03673335929dfa6e3559b520b512c393709b423dce945d19774/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f6c6f63616c2d6a736f6e2d66696c652d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/secretary/local-json-file-adapter)There are also miscellaneous packages that add on to Secretary

PackagePurposeBadges[PSR-6 Cache Adapter](https://github.com/secretary/php-psr-6-cache-adapter)Allows for caching secrets using a PSR-6 Cache Interface[![Latest Stable Version](https://camo.githubusercontent.com/03709e50fbbe35c92d6741637fd7de4c6319deadb1591232e225fa83c2146606/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7073722d362d63616368652d616461707465722f76657273696f6e)](https://packagist.org/packages/secretary/psr-6-cache-adapter) [![Total Downloads](https://camo.githubusercontent.com/86ac20134969ca54d9b50a625deac1d83df2ae1c072d6ab3bc26354c8d9b348d/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7073722d362d63616368652d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/secretary/psr-6-cache-adapter)[PSR-16 Cache Adapter](https://github.com/secretary/php-psr-16-cache-adapter)Allows for caching secrets using a PSR-16 Cache Interface[![Latest Stable Version](https://camo.githubusercontent.com/68bad978ab08fd623285a691a4bf523a0478f0089acc5dd025f19067ed2f2a97/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7073722d31362d63616368652d616461707465722f76657273696f6e)](https://packagist.org/packages/secretary/psr-16-cache-adapter) [![Total Downloads](https://camo.githubusercontent.com/70cd24e7273ec580bd60c68eb9383e983a970df4019ab4453262392f5a10b1c1/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7073722d31362d63616368652d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/secretary/psr-16-cache-adapter)[Secretary Bundle](https://github.com/secretary/php-secretary-bundle)Allows for integrating with the Symfony Framework[![Latest Stable Version](https://camo.githubusercontent.com/beda0b1c97b6f06b66b52acfdaeccc4a33542167d1fabd8667c0d531ae6f541e/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7365637265746172792d62756e646c652f76657273696f6e)](https://packagist.org/packages/secretary/secretary-bundle) [![Total Downloads](https://camo.githubusercontent.com/fbe366bf887f08c01dd74c3c273aab4262d09739257b06c21b95ab4f67020ada/68747470733a2f2f706f7365722e707567782e6f72672f7365637265746172792f7365637265746172792d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/secretary/secretary-bundle)Api Documentation
-----------------

[](#api-documentation)

There's two classes you interface with in Secretary:

- [`Secretary\Manager`](https://github.com/secretary/php/blob/master/src/Core/src/Manager.php)
- [`Secretary\Secret`](https://github.com/secretary/php/blob/master/src/Core/src/Secret.php)

### Secretary\\Manager

[](#secretarymanager)

#### Secretary\\Manager-&gt;\_\_construct(AdapterInterface $adapter)

[](#secretarymanager-__constructadapterinterface-adapter)

Pass in your desired adapter.

```
