Package org.keycloak.vault
Interface VaultCharSecret
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DefaultVaultCharSecret
A
CharBuffer
based representation of the secret obtained from the vault that supports automated cleanup of memory.- Author:
- Stefan Guilhen
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Destroys the secret in memory by e.g.get()
Returns the secret enclosed in aCharBuffer
.Optional<char[]>
Returns the secret in itschar[]
form.
-
Method Details
-
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
-