Re: ceriticate serial number extraction

From: Sergio Dutra [MS] (sergiod_at_online.microsoft.com)
Date: 09/10/03


Date: Wed, 10 Sep 2003 08:37:23 -0700


According to MSDN documentation for the SerialNumber member of the
CERT_INFO, the serial number is not encoded:

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.

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"machambi" <john310576@hotmail.com> wrote in message
news:7bc8b024.0309100652.1ac44af8@posting.google.com...
> Hi,
>   Can someone post me the code snippet to extract the certificate
> serial number from a certificate in this (6468 C047 2F93 A345 1234
> 315A 67CA 4F44) format ? I am using CryptoAPI and VC.
>   Do i have to use CryptDecodeObject to derive at the
> CRYPT_INTEGER_BLOB or do i use the value in the CERT_INFO structure
> directly. I am totally at loss here. Any help will be greatly
> appreciated
>
> Thanks
> John

Quantcast