Create the file with open_tmpfile_linkable_at(). Write the recovery key and trailing newline to the temporary fd. Set the final mode to 0600 before publishing it. Link it into place with link_tmpfile_at(..., LINK_TMPFILE_SYNC).
Create the file with open_tmpfile_linkable_at(). Write the recovery key and trailing newline to the temporary fd. Set the final mode to 0600 before publishing it. Link it into place with link_tmpfile_at(..., LINK_TMPFILE_SYNC).