-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding is not right in UniversalString #5
Labels
bug
Bug. An issue exist in our code.
Comments
Agree. The intent was to reverse 4-byte block for every character. .NET returns strings in little-endian byte sequence and we need big-endian sequence for ASN.1 |
var data = Encoding.UTF32.GetBytes(value.Reverse().ToArray()).Reverse().ToArray(); |
thanks for reporting, I've fixed this bug. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/PKISolutions/Asn1DerParser.NET/blob/master/Asn1Parser/Universal/Asn1UniversalString.cs
Line 50 and 53:
The encoding of "abc" in UTF32 is (in dec): 97 00 00 00 98 00 00 00 99 00 00 00
The Reverse() will make it to: 00 00 00 99 00 00 00 98 00 00 00 97
That may not be your wanted result right?
The text was updated successfully, but these errors were encountered: