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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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"


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.