Interface VaultCharSecret

All Superinterfaces:
AutoCloseable

public interface VaultCharSecret extends AutoCloseable
A CharBuffer based representation of the secret obtained from the vault that supports automated cleanup of memory.
Author:
Stefan Guilhen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Destroys the secret in memory by e.g.
    get()
    Returns the secret enclosed in a CharBuffer.
    Optional<char[]>
    Returns the secret in its char[] form.
  • Method Details

    • get

      Returns the secret enclosed in a CharBuffer.
      Returns:
      If the secret was successfully resolved by vault, returns an Optional containing the value returned by the vault as a CharBuffer (a valid value can be null), or an empty Optional
    • getAsArray

      Optional<char[]> getAsArray()
      Returns the secret in its char[] form.
      Returns:
      If the secret was successfully resolved by vault, returns an Optional containing the value returned by the vault as a char[] (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