@Test
public void testValidateSignatureHash() throws Exception {

  try {
    Validators.validateSignatureHash(HashType.SHA256);
    Validators.validateSignatureHash(HashType.SHA512);
  } catch (GeneralSecurityException e) {
    fail("Valid signature algorithm should work " + e);
  }
  try {
    Validators.validateSignatureHash(HashType.SHA1);
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    TestUtil.assertExceptionContains(e, "Unsupported hash: SHA1");
  }
}