title: CRYPT_INTEGER_BLOB to decimal string
body: <p>How can i convert the SerialNumber member of a <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa377200%28v=vs.85%29.aspx" rel="nofollow">CERT_INFO</a> structure to a string representation in base 10 preferable using C/C++</p>
  
  <p>The SerialNumber is <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa381414%28v=vs.85%29.aspx" rel="nofollow">CRYPT_INTEGER_BLOB</a> with contains two members the length, and an array of bytes.</p>
  
  <p>For cases where the SerialNumber has a maximum if 8 bytes is easy to copy the bytes to a <code>long long</code> and then use standard ostream operator to convert this to a string in base 10, but not sure how can i deal with case that the serial number contains more that 8 bytes, according to X509 spec CAs should handle up to 20 bytes.</p>