FileBasedSimpleKeyService
class FileBasedSimpleKeyService (View source)
File based simple encrypted key service
Constants
PATTERN_KEYNAME |
Pattern a key name must match. |
Properties
protected string | $passwordHashingStrategy | ||
protected int | $passwordGenerationLength | ||
protected HashService | $hashService |
Methods
No description
Generates a new key & saves it encrypted with a hashing strategy
Saves a key encrypted with a hashing strategy
Checks if a key exists
Returns a key by its name
Persists a key to the file system
Returns the path and filename for the key with the given name.
Checks if the given key name is valid amd returns it (unchanged) if yes. Otherwise it throws an exception.
Helper function to get the base path for key storage.
Details
void
injectSettings(array $settings)
No description
string
generateKey(string $name)
Generates a new key & saves it encrypted with a hashing strategy
void
storeKey(string $name, string $password)
Saves a key encrypted with a hashing strategy
bool
keyExists(string $name)
Checks if a key exists
bool
getKey(string $name)
Returns a key by its name
protected void
persistKey(string $name, string $password)
Persists a key to the file system
protected string
getKeyPathAndFilename(string $name)
Returns the path and filename for the key with the given name.
protected string
checkKeyName(string $name)
Checks if the given key name is valid amd returns it (unchanged) if yes. Otherwise it throws an exception.
protected string
getPath()
Helper function to get the base path for key storage.