You got this error because you didn't set security for your key file. To avoid this error, you can follow the below given commands. Open power shell from your windows system and run all the given commands one by one.
$icacls.exe $path /reset
$icacls.exe $path /inheritance:r
$icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
Hope this will solve your error.