x509_get_serialNumber can't get me the serial number in base 64

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

x509_get_serialNumber can't get me the serial number in base 64

Isaac B

Hi, I have the following code

 

char serial[300];

i2a_ASN1_INTEGER(bio, X509_get_serialNumber(x509));

n = BIO_read(bio, serial, min(BIO_pending(bio), 299));

n = max(n, 0);

serial[n] = 0;

BIO_flush(bio);

 

And I get the following result inside serial

 

3030303031303030303030303030303030313134

 

So those are the ASCIIs of the following number 00001000000000000114  ß  that is base 64

 

So how can I get that base 64 number, do I have to manually parse the array serial, make pairs of numbers,

then turn those numbers into a byte, and then put those bytes into an array of bytes, then convert that array

of bytes to base 64?

 

Or is there a shorter way to get to that base 64 number

 

Thanks in advance

                                    Isaac Briseño


Yahoo! FareChase - Search multiple travel sites in one click.