Implementing ability to save private key in PEM format in encrypted form