Interface SecretProvider
- All Known Subinterfaces:
ManagedSecretProvider
public interface SecretProvider
A
SecretProvider
exposed methods for listing, reading, and writing secrets managed by the provider.
Every provider must support reading secrets. Listing and writing secrets may not be supported by every provider.-
Method Summary
-
Method Details
-
list
List all secrets in this provider.- Returns:
- a list containing the names of every secret in this provider (never null)
- Throws:
SecretProviderException
- if there was a problem listing the secrets in this providerUnsupportedOperationException
- if this provider does not support listing secrets
-
read
Read a secret from this provider.- Parameters:
name
- the name of the secret to read. must not be null.- Returns:
- a
Plaintext
instance encapsulating the contents of the secret (never null) - Throws:
NoSuchElementException
- if no secret exists with the given nameNullPointerException
- if the given name argument is nullSecretProviderException
- if there was a problem reading the secret
-
write
Write a secret to this provider.- Parameters:
name
- the name of the secret to write. must not be null.plaintext
- aPlaintext
instance encapsulating the contents of the secret to write (note: the byte array wrapped by the provided Plaintext instance will not be mutated). must not be null.- Throws:
NoSuchElementException
- if no secret exists with the given nameNullPointerException
- if either of the given name or plaintext arguments are nullSecretProviderException
- if there was a problem writing the secretUnsupportedOperationException
- if this provider does not support writing to secrets
-