I encountered the same error. The cause was, using the KeyStore Explorer software, I was encrypting the RSA private key in addition to just exporting it.
So, basically, the code complains that it's reading an asymmetricly encrypted key pair while expecting an RSA private key.
I unchecked the "Encrypt" box, in the "export private key" dialog box befor exporting the .pem, and the exception disappeared.