test_class.declarator: tmpFolder = new TemporaryFolder()
test_class.modifier: @Rule public
test_class.original_string: @Rule public TemporaryFolder tmpFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: tmpFolder
test_class.file: java_src/src/test/java/com/google/crypto/tink/subtle/ValidatorsTest.java
test_class.identifier: ValidatorsTest
test_case.body: @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");
      }
    }
test_case.class_method_signature: ValidatorsTest.testValidateSignatureHash()
test_case.full_signature: @Test public void testValidateSignatureHash()
test_case.identifier: testValidateSignatureHash
test_case.invocations: validateSignatureHash validateSignatureHash fail validateSignatureHash fail assertExceptionContains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateSignatureHash()
focal_class.declarator: TYPE_URL_PREFIX = "type.googleapis.com/"
focal_class.modifier: private static final
focal_class.original_string: private static final String TYPE_URL_PREFIX = "type.googleapis.com/";
focal_class.type: String
focal_class.var_name: TYPE_URL_PREFIX
focal_class.declarator: MIN_RSA_MODULUS_SIZE = 2048
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_RSA_MODULUS_SIZE = 2048;
focal_class.type: int
focal_class.var_name: MIN_RSA_MODULUS_SIZE
focal_class.declarator: URI_UNRESERVED_CHARS = "([0-9a-zA-Z\\-\\.\\_~])+"
focal_class.modifier: private static final
focal_class.original_string: private static final String URI_UNRESERVED_CHARS = "([0-9a-zA-Z\\-\\.\\_~])+";
focal_class.type: String
focal_class.var_name: URI_UNRESERVED_CHARS
focal_class.declarator: GCP_KMS_CRYPTO_KEY_PATTERN =
        Pattern.compile(
            String.format(
                "^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s$",
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS),
            Pattern.CASE_INSENSITIVE)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern GCP_KMS_CRYPTO_KEY_PATTERN =
        Pattern.compile(
            String.format(
                "^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s$",
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS),
            Pattern.CASE_INSENSITIVE);
focal_class.type: Pattern
focal_class.var_name: GCP_KMS_CRYPTO_KEY_PATTERN
focal_class.declarator: GCP_KMS_CRYPTO_KEY_VERSION_PATTERN =
        Pattern.compile(
            String.format(
                "^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s/cryptoKeyVersions/%s$",
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS),
            Pattern.CASE_INSENSITIVE)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern GCP_KMS_CRYPTO_KEY_VERSION_PATTERN =
        Pattern.compile(
            String.format(
                "^projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s/cryptoKeyVersions/%s$",
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS,
                URI_UNRESERVED_CHARS),
            Pattern.CASE_INSENSITIVE);
focal_class.type: Pattern
focal_class.var_name: GCP_KMS_CRYPTO_KEY_VERSION_PATTERN
focal_class.file: java_src/src/main/java/com/google/crypto/tink/subtle/Validators.java
focal_class.identifier: Validators
focal_class.class_method_signature: Validators.Validators()
focal_class.full_signature: private  Validators()
focal_class.identifier: Validators
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Validators()
focal_class.class_method_signature: Validators.validateTypeUrl(String typeUrl)
focal_class.full_signature: public static void validateTypeUrl(String typeUrl)
focal_class.identifier: validateTypeUrl
focal_class.modifiers: public static
focal_class.parameters: (String typeUrl)
focal_class.return: void
focal_class.signature: void validateTypeUrl(String typeUrl)
focal_class.class_method_signature: Validators.validateAesKeySize(int sizeInBytes)
focal_class.full_signature: public static void validateAesKeySize(int sizeInBytes)
focal_class.identifier: validateAesKeySize
focal_class.modifiers: public static
focal_class.parameters: (int sizeInBytes)
focal_class.return: void
focal_class.signature: void validateAesKeySize(int sizeInBytes)
focal_class.class_method_signature: Validators.validateVersion(int candidate, int maxExpected)
focal_class.full_signature: public static void validateVersion(int candidate, int maxExpected)
focal_class.identifier: validateVersion
focal_class.modifiers: public static
focal_class.parameters: (int candidate, int maxExpected)
focal_class.return: void
focal_class.signature: void validateVersion(int candidate, int maxExpected)
focal_class.class_method_signature: Validators.validateSignatureHash(HashType hash)
focal_class.full_signature: public static void validateSignatureHash(HashType hash)
focal_class.identifier: validateSignatureHash
focal_class.modifiers: public static
focal_class.parameters: (HashType hash)
focal_class.return: void
focal_class.signature: void validateSignatureHash(HashType hash)
focal_class.class_method_signature: Validators.validateRsaModulusSize(int modulusSize)
focal_class.full_signature: public static void validateRsaModulusSize(int modulusSize)
focal_class.identifier: validateRsaModulusSize
focal_class.modifiers: public static
focal_class.parameters: (int modulusSize)
focal_class.return: void
focal_class.signature: void validateRsaModulusSize(int modulusSize)
focal_class.class_method_signature: Validators.validateRsaPublicExponent(
        BigInteger publicExponent)
focal_class.full_signature: public static void validateRsaPublicExponent(
        BigInteger publicExponent)
focal_class.identifier: validateRsaPublicExponent
focal_class.modifiers: public static
focal_class.parameters: (
        BigInteger publicExponent)
focal_class.return: void
focal_class.signature: void validateRsaPublicExponent(
        BigInteger publicExponent)
focal_class.class_method_signature: Validators.validateNotExists(File f)
focal_class.full_signature: public static void validateNotExists(File f)
focal_class.identifier: validateNotExists
focal_class.modifiers: public static
focal_class.parameters: (File f)
focal_class.return: void
focal_class.signature: void validateNotExists(File f)
focal_class.class_method_signature: Validators.validateExists(File f)
focal_class.full_signature: public static void validateExists(File f)
focal_class.identifier: validateExists
focal_class.modifiers: public static
focal_class.parameters: (File f)
focal_class.return: void
focal_class.signature: void validateExists(File f)
focal_class.class_method_signature: Validators.validateKmsKeyUriAndRemovePrefix(String expectedPrefix, String kmsKeyUri)
focal_class.full_signature: public static String validateKmsKeyUriAndRemovePrefix(String expectedPrefix, String kmsKeyUri)
focal_class.identifier: validateKmsKeyUriAndRemovePrefix
focal_class.modifiers: public static
focal_class.parameters: (String expectedPrefix, String kmsKeyUri)
focal_class.return: String
focal_class.signature: String validateKmsKeyUriAndRemovePrefix(String expectedPrefix, String kmsKeyUri)
focal_class.class_method_signature: Validators.validateCryptoKeyUri(String kmsKeyUri)
focal_class.full_signature: public static void validateCryptoKeyUri(String kmsKeyUri)
focal_class.identifier: validateCryptoKeyUri
focal_class.modifiers: public static
focal_class.parameters: (String kmsKeyUri)
focal_class.return: void
focal_class.signature: void validateCryptoKeyUri(String kmsKeyUri)
focal_method.body: public static void validateSignatureHash(HashType hash) throws GeneralSecurityException {
      switch (hash) {
        case SHA256: // fall through
        case SHA384: // fall through
        case SHA512:
          return;
        default:
          break;
      }
      throw new GeneralSecurityException("Unsupported hash: " + hash.name());
    }
focal_method.class_method_signature: Validators.validateSignatureHash(HashType hash)
focal_method.full_signature: public static void validateSignatureHash(HashType hash)
focal_method.identifier: validateSignatureHash
focal_method.invocations: name
focal_method.modifiers: public static
focal_method.parameters: (HashType hash)
focal_method.return: void
focal_method.signature: void validateSignatureHash(HashType hash)