Package org.keycloak.vault
Class DefaultVaultRawSecret
java.lang.Object
org.keycloak.vault.DefaultVaultRawSecret
- All Implemented Interfaces:
AutoCloseable
,VaultRawSecret
Default raw secret implementation for
byte[]
.- Author:
- hmlnarik
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Destroys the secret in memory by e.g.static VaultRawSecret
forBuffer
(Optional<ByteBuffer> buffer) get()
Returns the raw secret bytes.Optional<byte[]>
Returns the raw secret bytes inbyte[]
form.
-
Method Details
-
forBuffer
-
get
Description copied from interface:VaultRawSecret
Returns the raw secret bytes.- Specified by:
get
in interfaceVaultRawSecret
- Returns:
- If the secret was successfully resolved by vault, returns
an
Optional
containing the value returned by the vault (a valid value can benull
), or an emptyOptional
-
getAsArray
Description copied from interface:VaultRawSecret
Returns the raw secret bytes inbyte[]
form.- Specified by:
getAsArray
in interfaceVaultRawSecret
- Returns:
- If the secret was successfully resolved by vault, returns
an
Optional
containing the value returned by the vault (a valid value can benull
), or an emptyOptional
-
close
public void close()Description copied from interface:VaultRawSecret
Destroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVaultRawSecret
-