org.keycloak.vault

## Interface VaultStringSecret

- All Superinterfaces:
    AutoCloseable
  All Known Implementing Classes:
    DefaultVaultStringSecret

      public interface VaultStringSecret
      extends AutoCloseable

  A `String` based representation of the secret obtained from the vault that supports automated cleanup of memory. In this case, due to the immutable nature of strings, the cleanup should consist in releasing any references to the secret string so it can be disposed by the GC as soon as possible.
  Author:
    Stefan Guilhen

- - ### 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<String>` | `get()` Returns the secret represented as a `String`.

- - ### Method Detail

    - #### get

          Optional<String> get()

      Returns the secret represented as a `String`.
      Returns:
        If the secret was successfully resolved by vault, returns an `Optional` containing the value returned by the vault as a `String` (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 or release references in case of immutable secrets.
      Specified by:
        `close` in interface `AutoCloseable`

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