This logic here needs to be inverted. That is node-forge requires good password but when clicking on "import file" we don't have the password field shown yet.
I think we need to do only small level of sanity checks for X.509 keys here as it seems that's what the function is doing here (reads the key and immediately armors it discarding the object) and then do the full parse in checkPrv.
Originally posted by @wiktor-k in #3216 (comment)