CR and LF are no problem; the
in the exception message is just part of the exception message. The real
symptom is "ASN1 bad tag". That's because dotnet SignedCMS is for
Cryptographic Message Syntax (CMS) data, which is way different and MUCH
more complicated than a simple RSA signature as you've created. See RFC
3369 et al for details.
If you really want to use a near-raw signature (with PKCS#1 padding as
nearly everybody including Java does, but not algid, entity/key
identification, additional data, certs, type identification, etc.) you'll
need to do something different to receive it in Csharp. I can't help with
If you want to generate CMS SignedData in Java, see Sign
data using PKCS #7 in JAVA (BouncyCastle) or http://security.stackexchange.com/questions/13910/pkcs7-encoding-in-java-without-external-libs-like-bouncycastle-etc
If you're not wedded to Java, openssl (in highly portable C) also does a
good job on CMS/PKCS#7.