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 SummaryAll 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- 
forBufferpublic static VaultRawSecret forBuffer(Optional<ByteBuffer> buffer) 
 - 
getpublic Optional<ByteBuffer> get() Description copied from interface:VaultRawSecretReturns the raw secret bytes.- Specified by:
- getin interface- VaultRawSecret
- 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
 
 - 
getAsArraypublic Optional<byte[]> getAsArray() Description copied from interface:VaultRawSecretReturns the raw secret bytes inbyte[]form.- Specified by:
- getAsArrayin interface- VaultRawSecret
- 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
 
 - 
closepublic void close() Description copied from interface:VaultRawSecretDestroys the secret in memory by e.g. overwriting it with random garbage.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- VaultRawSecret
 
 
- 
 
-