News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Cert Serial number reversed?  
by Stuart
posted on 2004/06/14

Is there any sort of byte ordering I should be aware of for the serial number in a certificate? If I call the GetSerialNumber() functions, the output is reversed from what is shown in Internet Explorer. Thanks.

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/06/15

The Windows CryptoAPI uses little endian byte ordening and .NET/IE/... uses big endian byte ordening. The security library is a wrapper around the CryptoAPI, so under the covers everything is little endian but the seclib reverses the byte arrays to give the user the impression that he's working with big endian data. Unfortunately it's not always clear which arrays should be reversed.

The behavior you encountered is a bug. The security library should have returned that data in big endian order (like IE). It will be ixed in the next version of the library.
The same bug is present in .NET 1.0/1.1; this bug will also be fixed in .NET 2.0.

by Stuart
posted on 2004/06/15

Thanks.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.