[Mono-list] UTF8 Encoding of data in PKCS#7

Andreas Färber andreas.faerber at web.de
Wed Jan 18 07:07:23 EST 2006


> If you got a string you want PKCS#7 sign or envelope, are you then
> supposed to UTF8 encode it yourself before adding the data to the
> relevant Mono classes, or is that handled internally by Mono?
> I got a string where I can either choose:
>   byte[] data = System.Text.Encoding.UTF8.GetBytes(myString);
> or
>   byte[] data = System.Text.Encoding.Default.GetBytes(myString);
> The problem is compatibility with OpenSSL. If I choose to UTF8 encode 
> it
> (first choice), the text I extract using OpenSSL is not correct and it
> still seems UTF8 encoded.

Don't know about Mono's implementation but I did my own managed 
implementation once, and there are several different string types in 
ASN.1 - if Mono uses a non-UTF-8 one then noone will try to read it as 
UTF-8. ;-)


More information about the Mono-list mailing list