@CanIgnoreReturnValue
  public KmsClient withCredentials(GoogleCredential credential) {
    if (credential.createScopedRequired()) {
      credential = credential.createScoped(CloudKMSScopes.all());
    }
    this.cloudKms =
        new CloudKMS.Builder(new NetHttpTransport(), new GsonFactory(), credential)
            .setApplicationName(APPLICATION_NAME)
            .build();
    return this;
  }
Loads the provided credential with {@code GoogleCredential}.
java_src/src/main/java/com/google/crypto/tink/integration/gcpkms/GcpKmsClient.java