This documentation is archived and is not being maintained.

KeyContainerPermissionAccessEntry Constructor (String, String, Int32, String, Int32, KeyContainerPermissionFlags)

Initializes a new instance of the KeyContainerPermissionAccessEntry class with the specified property values.

Namespace:  System.Security.Permissions
Assembly:  mscorlib (in mscorlib.dll)

public KeyContainerPermissionAccessEntry(
	string keyStore,
	string providerName,
	int providerType,
	string keyContainerName,
	int keySpec,
	KeyContainerPermissionFlags flags


Type: System.String
The name of the key store.
Type: System.String
The name of the provider.
Type: System.Int32
The type code for the provider. See the ProviderType property for values.
Type: System.String
The name of the key container.
Type: System.Int32
The key specification. See the KeySpec property for values.
Type: System.Security.Permissions.KeyContainerPermissionFlags
A bitwise combination of the KeyContainerPermissionFlags values.


The resulting entry would have unrestricted access.

This constructor allows access rights to be assigned for specific key containers. A keySpec or providerType value of –1 represents all key specifications or provider types. A keyStore, providerName, or keyContainerName of "*" represents all key stores, providers, or key containers. A providerName or keyContainerName that is null represents all providers or key containers.

The following code example shows the use of the KeyContainerPermissionAccessEntry(String, String, Int32, String, Int32, KeyContainerPermissionFlags) constructor.

private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry3 = new KeyContainerPermissionAccessEntry(
    "Machine", providerName, providerType, myKeyContainerName, 1, 

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.