Class AbstractLookupKeyProvider
java.lang.Object
com.kingsrook.qqq.backend.core.crypto.AbstractLookupKeyProvider
- All Implemented Interfaces:
QKeyProviderInterface
- Direct Known Subclasses:
AwsSecretsManagerKeyProvider,EnvKeyProvider
Base for key providers that look up base64 text by name. Naming convention
for a keyRef NAME:
- NAME holds the CURRENT key (base64 of 32 bytes)
- NAME_VERSION optionally names the current version (default "1")
- NAME_V{version} holds the key for an older version, kept while data written
under it still exists
So rotating is: copy NAME to NAME_V{old}, put the new key in NAME, and set
NAME_VERSION to the new version.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringDescribe the source, for messages (e.g., "environment variable").Get the current version of the key.Get a specific version of the key.Look up the (base64) value stored under a name.
-
Field Details
-
DEFAULT_VERSION
- See Also:
-
-
Constructor Details
-
AbstractLookupKeyProvider
public AbstractLookupKeyProvider()
-
-
Method Details
-
lookup
-
describeSource
Describe the source, for messages (e.g., "environment variable"). -
getKey
Description copied from interface:QKeyProviderInterfaceGet the current version of the key.- Specified by:
getKeyin interfaceQKeyProviderInterface- Throws:
QException- if the key cannot be found or is invalid
-
getKey
Description copied from interface:QKeyProviderInterfaceGet a specific version of the key.- Specified by:
getKeyin interfaceQKeyProviderInterface- Throws:
QException- if that version of the key cannot be found or is invalid
-