Class VaultBytesKeyGenerator

java.lang.Object
org.springframework.vault.security.VaultBytesKeyGenerator
All Implemented Interfaces:
BytesKeyGenerator

public class VaultBytesKeyGenerator extends Object implements BytesKeyGenerator
Random byte generator using Vault's transit backend to generate high-quality random bytes of the configured length.

Using Vault ensures to use a high-entropy source preventing to consume entropy of the local machine.

Since:
2.0
Author:
Mark Paluch
  • Constructor Details

    • VaultBytesKeyGenerator

      public VaultBytesKeyGenerator(VaultOperations vaultOperations)
      Creates a new VaultBytesKeyGenerator initialized to generate 32 random bytes using transit for transit mount path.
      Parameters:
      vaultOperations - must not be null.
    • VaultBytesKeyGenerator

      public VaultBytesKeyGenerator(VaultOperations vaultOperations, String transitPath, int length)
      Creates a new VaultBytesKeyGenerator initialized to generate length random bytes.
      Parameters:
      vaultOperations - must not be null.
      transitPath - path of the transit backend, must not be null or empty.
      length - number of random bytes to generate. Must be greater than zero.
  • Method Details