Edit

Share via


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

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

public:
 KeyContainerPermissionAccessEntry(System::Security::Cryptography::CspParameters ^ parameters, System::Security::Permissions::KeyContainerPermissionFlags flags);
public KeyContainerPermissionAccessEntry (System.Security.Cryptography.CspParameters parameters, System.Security.Permissions.KeyContainerPermissionFlags flags);
new System.Security.Permissions.KeyContainerPermissionAccessEntry : System.Security.Cryptography.CspParameters * System.Security.Permissions.KeyContainerPermissionFlags -> System.Security.Permissions.KeyContainerPermissionAccessEntry
Public Sub New (parameters As CspParameters, flags As KeyContainerPermissionFlags)

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.

static KeyContainerPermissionAccessEntry^ keyContainerPermAccEntry2 = gcnew KeyContainerPermissionAccessEntry( cspParams,KeyContainerPermissionFlags::Open );
private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry2 = new KeyContainerPermissionAccessEntry(
    cspParams, KeyContainerPermissionFlags.Open);
Private Shared keyContainerPermAccEntry2 As _
    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

KeyContainerPermissionAccessEntry(String, KeyContainerPermissionFlags)

Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs

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

public:
 KeyContainerPermissionAccessEntry(System::String ^ keyContainerName, System::Security::Permissions::KeyContainerPermissionFlags flags);
public KeyContainerPermissionAccessEntry (string keyContainerName, System.Security.Permissions.KeyContainerPermissionFlags flags);
new System.Security.Permissions.KeyContainerPermissionAccessEntry : string * System.Security.Permissions.KeyContainerPermissionFlags -> System.Security.Permissions.KeyContainerPermissionAccessEntry
Public Sub New (keyContainerName As String, flags As KeyContainerPermissionFlags)

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.

static KeyContainerPermissionAccessEntry^ keyContainerPermAccEntry1 = gcnew KeyContainerPermissionAccessEntry( "MyKeyContainer",KeyContainerPermissionFlags::Create );
private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry1 = new KeyContainerPermissionAccessEntry(
    "MyKeyContainer", KeyContainerPermissionFlags.Create);
Private Shared keyContainerPermAccEntry1 As _
    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

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

Source:
KeyContainerPermissionAccessEntry.cs
Source:
KeyContainerPermissionAccessEntry.cs

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

public:
 KeyContainerPermissionAccessEntry(System::String ^ keyStore, System::String ^ providerName, int providerType, System::String ^ keyContainerName, int keySpec, System::Security::Permissions::KeyContainerPermissionFlags flags);
public KeyContainerPermissionAccessEntry (string keyStore, string providerName, int providerType, string keyContainerName, int keySpec, System.Security.Permissions.KeyContainerPermissionFlags flags);
new System.Security.Permissions.KeyContainerPermissionAccessEntry : string * string * int * string * int * System.Security.Permissions.KeyContainerPermissionFlags -> System.Security.Permissions.KeyContainerPermissionAccessEntry
Public Sub New (keyStore As String, providerName As String, providerType As Integer, keyContainerName As String, keySpec As Integer, flags As KeyContainerPermissionFlags)

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.

   static KeyContainerPermissionAccessEntry^ keyContainerPermAccEntry3 = gcnew KeyContainerPermissionAccessEntry( "Machine",providerName,providerType,myKeyContainerName,1,KeyContainerPermissionFlags::Open );

public:
private static KeyContainerPermissionAccessEntry 
    keyContainerPermAccEntry3 = new KeyContainerPermissionAccessEntry(
    "Machine", providerName, providerType, myKeyContainerName, 1, 
    KeyContainerPermissionFlags.Open);
Private Shared keyContainerPermAccEntry3 As _
    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