Reading a Private Key from PEM file

Hi All,

I’m trying to read a private key from a PEM file but getting the below error.

"j.s.s.InvalidKeySpecException: invalid key format’, forwarding to the next one".

I’m using the below function to read the pem file but looks like it’s not reading the entire file.


The output is as below.

Simulation Functions started…
[B@70602010Success-2 12:11:37.717 [ERROR] i.g.c.a.b.SessionHookBuilder$$anon$1 - ‘hook-2’ crashed with ‘j.s.s.InvalidKeySpecException: invalid key format’, forwarding to the next one

Hi All,

Please execuse my lack of knowledge on scala.

I’m reading a file content as a string using


I want the new line to be replaced with \n character.

Please can you suggest me if there is a way to read that way.


Thank you !!!

This issue is resolved. Thanks !!!