@CanIgnoreReturnValue
  @Override
  public KmsClient withCredentials(String credentialPath) throws GeneralSecurityException {
    if (credentialPath == null) {
      return withDefaultCredentials();
    }
    try {
      GoogleCredentials credentials =
          GoogleCredentials.fromStream(new FileInputStream(new File(credentialPath)));
      return withCredentials(credentials);
    } catch (IOException e) {
      throw new GeneralSecurityException("cannot load credentials", e);
    }
  }
Loads credentials from a service account JSON file {@code credentialPath}.

<p>If {@code credentialPath} is null, loads <a
href="https://developers.google.com/accounts/docs/application-default-credentials" default
Google Cloud credentials</a>.
java_src/src/main/java/com/google/crypto/tink/integration/gcpkms/GcpKmsClient.java