Прочетете на английски Редактиране

Споделяне чрез


KeyContainerPermissionAccessEntry Constructors

Definition

Initializes a new instance of the KeyContainerPermissionAccessEntry class.

Overloads

KeyContainerPermissionAccessEntry(CspParameters, KeyContainerPermissionFlags)

Initializes a new instance of the KeyContainerPermissionAccessEntry class, using the specified cryptographic service provider (CSP) parameters and access permissions.

KeyContainerPermissionAccessEntry(String, KeyContainerPermissionFlags)

Initializes a new instance of the KeyContainerPermissionAccessEntry class, using the specified key container name and access permissions.

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

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

KeyContainerPermissionAccessEntry(CspParameters, KeyContainerPermissionFlags)

Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs

Initializes a new instance of the KeyContainerPermissionAccessEntry class, using the specified cryptographic service provider (CSP) parameters and access permissions.

C#
public KeyContainerPermissionAccessEntry(System.Security.Cryptography.CspParameters parameters, System.Security.Permissions.KeyContainerPermissionFlags flags);

Parameters

parameters
CspParameters

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

flags
KeyContainerPermissionFlags

A bitwise combination of the KeyContainerPermissionFlags values.

Exceptions

The resulting entry would have unrestricted access.

Examples

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

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

Remarks

This constructor allows access rights to be assigned for specific key containers identified in a CspParameters object.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

KeyContainerPermissionAccessEntry(String, KeyContainerPermissionFlags)

Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs

Initializes a new instance of the KeyContainerPermissionAccessEntry class, using the specified key container name and access permissions.

C#
public KeyContainerPermissionAccessEntry(string keyContainerName, System.Security.Permissions.KeyContainerPermissionFlags flags);

Parameters

keyContainerName
String

The name of the key container.

flags
KeyContainerPermissionFlags

A bitwise combination of the KeyContainerPermissionFlags values.

Exceptions

The resulting entry would have unrestricted access.

Examples

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

C#
private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry1 = new KeyContainerPermissionAccessEntry(
    "MyKeyContainer", KeyContainerPermissionFlags.Create);

Remarks

This constructor allows you to specify access rights for specific key containers identified by name; use an asterisk ("*") to represent all the key containers.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

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

Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs

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

C#
public KeyContainerPermissionAccessEntry(string keyStore, string providerName, int providerType, string keyContainerName, int keySpec, System.Security.Permissions.KeyContainerPermissionFlags flags);

Parameters

keyStore
String

The name of the key store.

providerName
String

The name of the provider.

providerType
Int32

The type code for the provider. See the ProviderType property for values.

keyContainerName
String

The name of the key container.

keySpec
Int32

The key specification. See the KeySpec property for values.

flags
KeyContainerPermissionFlags

A bitwise combination of the KeyContainerPermissionFlags values.

Exceptions

The resulting entry would have unrestricted access.

Examples

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

C#
private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry3 = new KeyContainerPermissionAccessEntry(
    "Machine", providerName, providerType, myKeyContainerName, 1, 
    KeyContainerPermissionFlags.Open);

Remarks

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.

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10