Package org.keycloak.vault
Class DefaultVaultCharSecret
java.lang.Object
org.keycloak.vault.DefaultVaultCharSecret
- All Implemented Interfaces:
AutoCloseable,VaultCharSecret
Default
VaultCharSecret implementation based on CharBuffer.- Author:
- Stefan Guilhen
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Destroys the secret in memory by e.g.static VaultCharSecretforBuffer(Optional<CharBuffer> buffer) get()Returns the secret enclosed in aCharBuffer.Optional<char[]>Returns the secret in itschar[]form.
-
Method Details
-
forBuffer
-
get
Description copied from interface:VaultCharSecretReturns the secret enclosed in aCharBuffer.- Specified by:
getin interfaceVaultCharSecret- Returns:
- If the secret was successfully resolved by vault, returns an
Optionalcontaining the value returned by the vault as aCharBuffer(a valid value can benull), or an emptyOptional
-
getAsArray
Description copied from interface:VaultCharSecretReturns the secret in itschar[]form.- Specified by:
getAsArrayin interfaceVaultCharSecret- Returns:
- If the secret was successfully resolved by vault, returns an
Optionalcontaining the value returned by the vault as achar[](a valid value can benull), or an emptyOptional.
-
close
public void close()Description copied from interface:VaultCharSecretDestroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVaultCharSecret
-