Fix bug in formatPrivateKey method, the key could be not RSA