KeyContainerPermissionAccessEntry Constructor (CspParameters, KeyContainerPermissionFlags)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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
)

Parameters

parameters
Type: System.Security.Cryptography.CspParameters

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

flags
Type: System.Security.Permissions.KeyContainerPermissionFlags

A bitwise combination of the KeyContainerPermissionFlags values.

Exception Condition
ArgumentException

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
Show: