Package org.keycloak.vault
Class DefaultVaultCharSecret
- java.lang.Object
-
- org.keycloak.vault.DefaultVaultCharSecret
-
- All Implemented Interfaces:
AutoCloseable,VaultCharSecret
public class DefaultVaultCharSecret extends Object implements VaultCharSecret
DefaultVaultCharSecretimplementation based onCharBuffer.- Author:
- Stefan Guilhen
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Destroys the secret in memory by e.g.static VaultCharSecretforBuffer(Optional<CharBuffer> buffer)Optional<CharBuffer>get()Returns the secret enclosed in aCharBuffer.Optional<char[]>getAsArray()Returns the secret in itschar[]form.
-
-
-
Method Detail
-
forBuffer
public static VaultCharSecret forBuffer(Optional<CharBuffer> buffer)
-
get
public Optional<CharBuffer> 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
public Optional<char[]> 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
-
-