How do I add a private file to node's file field from Base64 in code
my final solution was next:

$node = Node::load($data['case_id']);
$files = $node-&gt;field_case_file;
$dfSettings = $files-&gt;getDataDefinition()-&gt;getSettings();
$destination = $dfSettings['uri_scheme'].'://'.$dfSettings['file_directory'].'/'.$filename;
$destination = \Drupal::token()-&gt;replace($destination);
$file = file_save_data(base64_decode($fileData), $destination, FILE_EXISTS_RENAME);

$violations = $files-&gt;appendItem($file)-&gt;validate();

if(count($violations)) {
//throw error
}

$node-&gt;save();