J
John Allberg
Hi!
There is a bug i X509Certificate.GetSerialNumber and
X509Certificate.GetSerialNumberString where the serialnumber bytes is in the
reverse order.
Example:
Open a verisign certificate. Verisign certificates have very long
serialnumbers, since they are generated from a hash value.
For my verisign certificate:
X509Certificate.GetSerialNumberString returns
FC67A62CBA193D0198061E48E65B8457
GetSerialNumber returns the same, even though it is in bytes.
When opening the certificate in explorer and looking at the serialnumber
field:
57 84 5b e6 48 1e 06 98 01 3d 19 ba 2c a6 67 fc
When parsing the certificate in an asn1 browser:
0 30 869: SEQUENCE {
4 30 718: SEQUENCE {
8 A0 3: [0] {
10 02 1: INTEGER 2
: }
13 02 16: INTEGER
: 57 84 5B E6 48 1E 06 98 01 3D 19 BA 2C A6 67 FC
When looking in Verisign admin tools, it is reported as
57845be6481e0698013d19ba2ca667fc
As you can see, this is the reverse of what X509Certificate.GetSerialNumber
reports. I'd say this is a bug.
Regards,
John Allberg
PS. This is a post using MSDN MSDN Managed Newsgroups with a registered MSDN
nospam mail account. It never worked for me before, but hey, sometime is
going to be the first, right? DS.
There is a bug i X509Certificate.GetSerialNumber and
X509Certificate.GetSerialNumberString where the serialnumber bytes is in the
reverse order.
Example:
Open a verisign certificate. Verisign certificates have very long
serialnumbers, since they are generated from a hash value.
For my verisign certificate:
X509Certificate.GetSerialNumberString returns
FC67A62CBA193D0198061E48E65B8457
GetSerialNumber returns the same, even though it is in bytes.
When opening the certificate in explorer and looking at the serialnumber
field:
57 84 5b e6 48 1e 06 98 01 3d 19 ba 2c a6 67 fc
When parsing the certificate in an asn1 browser:
0 30 869: SEQUENCE {
4 30 718: SEQUENCE {
8 A0 3: [0] {
10 02 1: INTEGER 2
: }
13 02 16: INTEGER
: 57 84 5B E6 48 1E 06 98 01 3D 19 BA 2C A6 67 FC
When looking in Verisign admin tools, it is reported as
57845be6481e0698013d19ba2ca667fc
As you can see, this is the reverse of what X509Certificate.GetSerialNumber
reports. I'd say this is a bug.
Regards,
John Allberg
PS. This is a post using MSDN MSDN Managed Newsgroups with a registered MSDN
nospam mail account. It never worked for me before, but hey, sometime is
going to be the first, right? DS.