Package org.keycloak.vault
Class DefaultVaultRawSecret
- java.lang.Object
-
- org.keycloak.vault.DefaultVaultRawSecret
-
- All Implemented Interfaces:
AutoCloseable,VaultRawSecret
public class DefaultVaultRawSecret extends Object implements VaultRawSecret
Default raw secret implementation forbyte[].- Author:
- hmlnarik
-
-
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 VaultRawSecretforBuffer(Optional<ByteBuffer> buffer)Optional<ByteBuffer>get()Returns the raw secret bytes.Optional<byte[]>getAsArray()Returns the raw secret bytes inbyte[]form.
-
-
-
Method Detail
-
forBuffer
public static VaultRawSecret forBuffer(Optional<ByteBuffer> buffer)
-
get
public Optional<ByteBuffer> get()
Description copied from interface:VaultRawSecretReturns the raw secret bytes.- Specified by:
getin interfaceVaultRawSecret- Returns:
- If the secret was successfully resolved by vault, returns
an
Optionalcontaining the value returned by the vault (a valid value can benull), or an emptyOptional
-
getAsArray
public Optional<byte[]> getAsArray()
Description copied from interface:VaultRawSecretReturns the raw secret bytes inbyte[]form.- Specified by:
getAsArrayin interfaceVaultRawSecret- Returns:
- If the secret was successfully resolved by vault, returns
an
Optionalcontaining the value returned by the vault (a valid value can benull), or an emptyOptional
-
close
public void close()
Description copied from interface:VaultRawSecretDestroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVaultRawSecret
-
-