One of my API methods returns an RSA key in the following format:
"publickey" : "-----BEGIN PUBLIC KEY-----\nMIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5WleAVeW5gySd
QVFkTi44q1cE\ncWDT2gmcv2mHcWhwI/9YqGV2LqpMASe
4t4XS/88fvTTHafHn1KaL9F7d73T9k4cp\nm+YxKJexkK
/wOxf/NZBieoADaLLaU1+OoPauSw3i4DZxKqIm1nxNHSV
LUfyY44gN\nClVxtZzW/nwdWEdSQwIDAQAB\n-----END PUBLIC KEY-----\n"
However, when I receive this public key and store it in a variable on the client side,
var key = data.publickey
The \n
symbols are not present in the key
variable, but they are necessary for proper document signing.
Is there a way to preserve the \n
in the string?