org.keycloak.vault

## Interface VaultRawSecret

- All Superinterfaces:
    AutoCloseable
  All Known Implementing Classes:
    DefaultVaultRawSecret

      public interface VaultRawSecret
      extends AutoCloseable

  Raw representation of the secret obtained from vault that supports automated cleanup of memory.
  Author:
    hmlnarik

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Destroys the secret in memory by e.g.
    `Optional<ByteBuffer>` | `get()` Returns the raw secret bytes.
    `Optional<byte[]>` | `getAsArray()` Returns the raw secret bytes in `byte[]` form.

- - ### Method Detail

    - #### get

          Optional<ByteBuffer> get()

      Returns the raw secret bytes.
      Returns:
        If the secret was successfully resolved by vault, returns an `Optional` containing the value returned by the vault (a valid value can be `null`), or an empty `Optional`

    - #### getAsArray

          Optional<byte[]> getAsArray()

      Returns the raw secret bytes in `byte[]` form.
      Returns:
        If the secret was successfully resolved by vault, returns an `Optional` containing the value returned by the vault (a valid value can be `null`), or an empty `Optional`

    - #### close

          void close()

      Destroys the secret in memory by e.g. overwriting it with random garbage.
      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 2021 JBoss by Red Hat. All rights reserved.