@Override
  public Aead getAead(String uri) throws GeneralSecurityException {
    if (this.keyUri != null && !this.keyUri.equals(uri)) {
      throw new GeneralSecurityException(
          String.format(
              "this client is bound to %s, cannot load keys bound to %s", this.keyUri, uri));
    }

    try {
      String keyId = removePrefix(PREFIX, uri);
      AWSKMS client = awsKms;
      List<String> tokens = Splitter.on(':').splitToList(keyId);
      if (tokens.size() < 4) {
        throw new IllegalArgumentException("invalid key URI");
      }
      String regionName = tokens.get(3);
      if (client == null) {
        client =
            AWSKMSClientBuilder.standard()
                .withCredentials(provider)
                .withRegion(Regions.fromName(regionName))
                .build();
      }
      return new AwsKmsAead(client, keyId);
    } catch (AmazonServiceException e) {
      throw new GeneralSecurityException("cannot load credentials from provider", e);
    }
  }
Specifies the {@link com.amazonaws.services.kms.AWSKMS} object to be used. Only used for
testing.
java_src/src/main/java/com/google/crypto/tink/integration/awskms/AwsKmsClient.java