Hi
Based on my discussion with our support team, it seems that the behavior is
by design.
Here is the reply from senior escalation engineer.
X509Certificate.GetSerialNumber Method returns the serial number of the
X.509v3 certificate in "little endian" form.
====When using Crypto API===
CryptoAPI returns the serial number in the CERT_INFO structure. The serial
number is returned in little endian format rather than big endian format.
Here is what the documentation states:
SerialNumber
"BLOB containing the certificate's serial number. The least significant
byte is the zero byte of the pbData member of SerialNumber. The index for
the last byte of pbData. is one less than the value of the cbData member of
SerialNumber. The most significant byte is the last byte of pbData. Leading
0x00 or 0xFF bytes are removed. See CertCompareIntegerBlob."
It is normally up to the application using CryptoAPI to reverse the bytes
for display to match up with the standard CryptUI view (Explorer) or other
verisign tools.
====When using Crypto API===
X509Certificate.GetSerialNumber is returning the exact bytes returned by
CryptoAPI and is working as per the designed behavior.
It is up to the application to reverse the bytes to match up with other UI
tools.
If you still have any concern, please feel free to post here.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.