Contracts
SecretsInterface
v1.0.0Encrypted secrets storage. API keys, tokens, and credentials are stored encrypted at rest.
Methods
public function get(string $key): ?stringRetrieve and decrypt a secret value.
public function set(string $key, string $value): voidEncrypt and store a secret value.
public function delete(string $key): voidRemove a secret.
public function has(string $key): boolCheck 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');
}