KeyContainerPermissionAccessEntry Constructor (CspParameters, 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, using the specified cryptographic service provider (CSP) parameters and access permissions.

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

public KeyContainerPermissionAccessEntry(
	CspParameters parameters,
	KeyContainerPermissionFlags flags


Type: System.Security.Cryptography.CspParameters

A CspParameters object that contains the cryptographic service provider (CSP) parameters.

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 identified in a CspParameters object.

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

private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry2 = new KeyContainerPermissionAccessEntry(
    cspParams, KeyContainerPermissionFlags.Open);

.NET Framework
Available since 2.0
Return to top