org.keycloak.vault

## Class DefaultVaultStringSecret

- java.lang.Object
- - org.keycloak.vault.DefaultVaultStringSecret

- All Implemented Interfaces:
    AutoCloseable, VaultStringSecret

      public class DefaultVaultStringSecret
      extends Object
      implements VaultStringSecret

  Default `VaultCharSecret` implementation based on `String`.
  Author:
    Stefan Guilhen

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Destroys the secret in memory by e.g.
    `static VaultStringSecret` | `forString(Optional<String> secret)`
    `Optional<String>` | `get()` Returns the secret represented as a `String`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### forString

          public static VaultStringSecret forString(Optional<String> secret)

    - #### get

          public Optional<String> get()

      Description copied from interface: `VaultStringSecret`
      Returns the secret represented as a `String`.
      Specified by:
        `get` in interface `VaultStringSecret`
      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

          public void close()

      Description copied from interface: `VaultStringSecret`
      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`
      Specified by:
        `close` in interface `VaultStringSecret`

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