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 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