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 -
obautistaAsked:
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
http://blogs.msdn.com/alejacma/archive/2007/12/13/key-containers-basics.aspx

"Key containers can be found here by default:

+ User containers:

- Vista:

C:\Users\\AppData\Roaming\Microsoft\Crypto\RSA

- 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"


0
 
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)  
http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx
0
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.