Libdigidocpp: getting certificate serial number.

24 views
Skip to first unread message

Antonio Araujo Brett

unread,
Mar 28, 2011, 5:13:30 PM3/28/11
to esteid-devel
Dear friends of esteid-devel, I hope all your activities are fine.

After reading Libdigidocpp code I could see that certificate serial
number can be retrieved with function:

long digidoc::X509Cert::getSerial().

This function uses OpenSSL ASN1_INTEGER_get to return serial as long.
What do you think about getting certificate serial as hexadecimal or
decimal string using OpenSSL BIGNUM through ASN1_INTEGER_to_BN()?.
Once you get BIGNUM you could use the appropiate bn function in order
to get serial in hex or dec. This could avoid throwing an exception on
Libdigidocpp when it reads big serial numbers in some machines. It
could provide backward compatibility.

Best regards

Antonio

Kalev Lember

unread,
Jul 4, 2011, 8:30:05 AM7/4/11
to esteid...@googlegroups.com
On 03/29/2011 12:13 AM, Antonio Araujo Brett wrote:
[snip]

> long digidoc::X509Cert::getSerial().
>
> This function uses OpenSSL ASN1_INTEGER_get to return serial as long.
> What do you think about getting certificate serial as hexadecimal or
> decimal string using OpenSSL BIGNUM through ASN1_INTEGER_to_BN()?.
> Once you get BIGNUM you could use the appropiate bn function in order
> to get serial in hex or dec. This could avoid throwing an exception on
> Libdigidocpp when it reads big serial numbers in some machines. It
> could provide backward compatibility.

I think it would be a nice fix. Do you have a patch for that?

(Sorry for the extremely late reply.)

--
Kalev

Reply all
Reply to author
Forward
0 new messages