Re: Getting the SHA1 Hask of a certificate public key



On Fri, 16 Dec 2005 23:47:26 +0200, Mike B wrote:


> "lelteto" <lelteto@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>
>> 1. WHY do you need the SHA-1 hash of the public key?
>>
>>2. If you plan to use the SHA-1 hash in YOUR (proprietary) .....
>>
> Don't make assumptions about MY proprietary software, my friend!
>
> Take a look at the PKWARE appnote and you will understand that MD5 is
> not the only hash used in everyday Crypto, and in particular, for
> supporting certificate based encryption in zip archives. (As
> implemented by RSA BSAFE cryptographic library).
>
> Your hashing recommendations will not work.
>
> In fact the SHA1 hash is quite straightforward to get (as I discovered
> eventually) by passing the CERT_KEY_IDENTIFIER_PROP_ID property constant
> to the CertGetCertificateContextProperty function.
>
> My concern is that this may not work for all certificates.
>
> regards
> Mike

As I recall, the form of the CERT_KEY_IDENTIFIER property will indeed
vary, depending on the certificate.

The hashing method described by Laszlo will work fine, though.

Regards,
John
.



Relevant Pages

  • Hashing, Signing and Encryption using an X509 Certificate from the Certificate Store
    ... stored in my local machine certificate store. ... bytehash; ... // We will use the public key to encrypt the SQL Connection string. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Verifying Signed Files Downloaded via HTTP
    ... one of your xml elements for the file. ... verify the new hash run over the file bits match the hash from the server. ... > associated with the main application and will automatically download ... > Another thing to note is that I renewed my Digital Certificate on ...
    (microsoft.public.dotnet.security)
  • Re: Collision in SHA-0
    ... The entity requesting the certificate can often ... >able to find collisions in the underlying hash function, ... There are collisions and then there are collisions. ... same length as a cert and the same hash. ...
    (sci.crypt)
  • Re: windows onecare update
    ... Hash: SHA1 ... Microsoft and wants to install antivirus/antispyware updates. ... me the site's certificate was issued by an untrusted authority. ...
    (microsoft.public.windowsxp.general)
  • Re: Finding Certificate by MD5 hash
    ... Craig, there may be a couple of easier ways to do this. ... first create a certificate context - it looks like ... Note, I believe that's the hash of the whole cert, ... Note, if you really want to hash just the public key, verify that you're ...
    (microsoft.public.platformsdk.security)