Package org.keycloak.vault
Interface VaultCharSecret
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DefaultVaultCharSecret
public interface VaultCharSecret extends AutoCloseable
ACharBuffer
based representation of the secret obtained from the vault that supports automated cleanup of memory.- Author:
- Stefan Guilhen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Destroys the secret in memory by e.g.Optional<CharBuffer>
get()
Returns the secret enclosed in aCharBuffer
.Optional<char[]>
getAsArray()
Returns the secret in itschar[]
form.
-
-
-
Method Detail
-
get
Optional<CharBuffer> get()
Returns the secret enclosed in aCharBuffer
.- Returns:
- If the secret was successfully resolved by vault, returns an
Optional
containing the value returned by the vault as aCharBuffer
(a valid value can benull
), or an emptyOptional
-
getAsArray
Optional<char[]> getAsArray()
Returns the secret in itschar[]
form.
-
close
void close()
Destroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
close
in interfaceAutoCloseable
-
-