Class DigestProvider.DigestSupport

java.lang.Object
io.helidon.security.spi.DigestProvider.DigestSupport
Enclosing interface:
DigestProvider<T extends ProviderConfig>

public static class DigestProvider.DigestSupport extends Object
Digest support created for each named digest configuration, used by Security for Security.digest(String, byte[]) and Security.verifyDigest(String, byte[], String) methods.
  • Constructor Details

  • Method Details

    • create

      public static DigestProvider.DigestSupport create(DigestProvider.DigestFunction digestFunction, DigestProvider.VerifyFunction verifyFunction)
      Create a new support based on digest and verify functions.
      Parameters:
      digestFunction - digest function
      verifyFunction - verify function
      Returns:
      new digest support
    • digest

      public String digest(byte[] bytes, boolean preHashed)
      Generates a signature or an HMAC.
      Parameters:
      bytes - bytes to sign
      preHashed - whether the bytes are pre-hashed
      Returns:
      future with the digest (signature or HMAC)
    • verify

      public boolean verify(byte[] bytes, boolean preHashed, String digest)
      Verifies a signature or an HMAC.
      Parameters:
      bytes - bytes to verify
      preHashed - whether the bytes are pre-hashed
      digest - digest obtained from a third-part
      Returns:
      future with true if the digest is valid, false if not valid, and an error if not a supported digest