How to check if a Key Container Exists

Is there a way to check if a Key Container exists?  I have created one and encrypted sections of the web.config.  All this works as expected.   I am wondering if there is a way to check through code if a Custom Key Container exists?

Thanks for any help or ideas -
Who is Participating?
Bob LearnedCommented:
I don't have any idea, but this is a really good question. Key containers are stored in different places, depending on what kind (machine or user), and what operating system.

Key Containers: Basics

"Key containers can be found here by default:

+ User containers:

- Vista:


- Previous Windows:

C:\Documents and Settings\\Application Data\Microsoft\Crypto\RSA

+ Machine containers:

- Vista:

C:\Users\All Users\Application Data\Microsoft\Crypto\RSA

- Previous Windows:

C:\Documents and Settings\all users\Application Data\Microsoft\Crypto\RSA"

Bob LearnedCommented:
I know that you can configure the key container with ASPREG_IIS, but I don't see a way to enumerate key containers:

ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.