Can I remove new lines from the rsa public key file to get a one line string? So the question is if the key looks like this
AAA BBB CCC
is this the same as
I'm assuming you mean a base 64 encoded key file, since removing the newlines from a binary file would obviously break things.
The RSA standards (e.g. RFC 2459) only define a binary representation for keys. In practice, like OpenPGP keys (RFC 4880), they are often encoded in base 64 using the otherwise obsolete PEM standards (RFC 1421).
The PEM printable encoding section says:
The OpenPGP radix 64 section says:
For SSH, on the other hand, RFC 4716 Section 3:
Do implementations in practice accept longer lines? I would expect many to do so. However, while no information is lost, it's technically nonconforming to use such encodings.