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 SummaryAll 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- 
forBufferpublic static VaultCharSecret forBuffer(Optional<CharBuffer> buffer) 
 - 
getpublic Optional<CharBuffer> get() Description copied from interface:VaultCharSecretReturns the secret enclosed in aCharBuffer.- Specified by:
- getin interface- VaultCharSecret
- 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
 
 - 
getAsArraypublic Optional<char[]> getAsArray() Description copied from interface:VaultCharSecretReturns the secret in itschar[]form.- Specified by:
- getAsArrayin interface- VaultCharSecret
- 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.
 
 - 
closepublic void close() Description copied from interface:VaultCharSecretDestroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- VaultCharSecret
 
 
- 
 
-