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


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

Public Sub New (
	keyStore As String,
	providerName As String,
	providerType As Integer,
	keyContainerName As String,
	keySpec As Integer,
	flags As KeyContainerPermissionFlags


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.

Exception Condition

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 Shared keyContainerPermAccEntry3 As _
    New KeyContainerPermissionAccessEntry("Machine", providerName, providerType, _
        myKeyContainerName, 1, KeyContainerPermissionFlags.Open)

.NET Framework
Available since 2.0
Return to top