Iterate through all certificates in the Certificate Store on Windows Azure

Pretty simple generic C# code to iterate through all certificates in the Windows Certificate Store and dump some metadata about each to standard output. Note that it really gets ALL certificates and doesn’t hard-code any stores or locations.

And just for fun, here is a dump of the certificates running on a Windows Azure Web Role (I did not install any add’l certificates on this instance):

6 thoughts on “Iterate through all certificates in the Certificate Store on Windows Azure

  1. Pingback: Resolving “certificate for the given thumbprint could not be loaded” error with Azure Tools for Visual Studio « Coding Out Loud

  2. KevinAG

    It doesn’t get certificates from all stores, just those in the StoreNames enumeration. For example, on Windows Server 2012, there is a new store folder called “Web Hosting”. This code will not get any certificates located in there.

    Looks like the only way to get a list of all Store Names is by using unmanaged methods like CertEnumSystemStore.

    Reply
    1. KevinAG

      My above post got cut off. Here is the second sentence.

      For example, on Windows Server 2012, there is a new store folder called “Web Hosting”.

      Reply
  3. KevinAG

    Something is wrong with your comments system.

    For example, on Windows Server 2012, there is a new store folder called….

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s