Class SecretFactory

java.lang.Object
com.codingchili.core.security.SecretFactory

public abstract class SecretFactory extends Object
Generates and verifies secret keys.
  • Constructor Details

    • SecretFactory

      public SecretFactory()
  • Method Details

    • generate

      public static String generate(int bytes)
      Generate a random secret of the given length.
      Parameters:
      bytes - length of the secret in bytes.
      Returns:
      number of random bytes specified.
    • verify

      public static boolean verify(String origin, String clone)
      Verifies that two given secrets are equal.
      Parameters:
      origin - the kept secret.
      clone - the secret to verify.
      Returns:
      true if an exact match is found.