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 TypeMethodDescriptionvoid
close()
Destroys the secret in memory by e.g.static VaultCharSecret
forBuffer
(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:VaultCharSecret
Returns the secret enclosed in aCharBuffer
.- Specified by:
get
in interfaceVaultCharSecret
- 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
Description copied from interface:VaultCharSecret
Returns the secret in itschar[]
form.- Specified by:
getAsArray
in interfaceVaultCharSecret
- Returns:
- If the secret was successfully resolved by vault, returns an
Optional
containing the value returned by the vault as achar[]
(a valid value can benull
), or an emptyOptional
.
-
close
public void close()Description copied from interface:VaultCharSecret
Destroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVaultCharSecret
-