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 void
close()
Destroys the secret in memory by e.g.static VaultRawSecret
forBuffer(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: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
public Optional<byte[]> 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
-
-