Contracts

SecretsInterface

v1.0.0

Encrypted secrets storage. API keys, tokens, and credentials are stored encrypted at rest.

Methods

public function get(string $key): ?string

Retrieve and decrypt a secret value.

public function set(string $key, string $value): void

Encrypt and store a secret value.

public function delete(string $key): void

Remove a secret.

public function has(string $key): bool

Check if a secret exists.

Example

secrets-interface.php
$this->secrets->set('stripe_key', 'sk_live_...');

if ($this->secrets->has('stripe_key')) {
    $key = $this->secrets->get('stripe_key');
}