CspParameters Class

 
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.

Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptographic computations. This class cannot be inherited.

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

System.Object
  System.Security.Cryptography.CspParameters

[<Sealed>]
[<ComVisibleAttribute(true)>]
type CspParameters = class end

NameDescription
System_CAPS_pubmethodCspParameters()

Initializes a new instance of the CspParameters class.

System_CAPS_pubmethodCspParameters(Int32)

Initializes a new instance of the CspParameters class with the specified provider type code.

System_CAPS_pubmethodCspParameters(Int32, String)

Initializes a new instance of the CspParameters class with the specified provider type code and name.

System_CAPS_pubmethodCspParameters(Int32, String, String)

Initializes a new instance of the CspParameters class with the specified provider type code and name, and the specified container name.

System_CAPS_pubmethodCspParameters(Int32, String, String, CryptoKeySecurity, IntPtr)

Initializes a new instance of the CspParameters class using a provider type, a provider name, a container name, access information, and a handle to an unmanaged smart card password dialog.

System_CAPS_pubmethodCspParameters(Int32, String, String, CryptoKeySecurity, SecureString)

Initializes a new instance of the CspParameters class using a provider type, a provider name, a container name, access information, and a password associated with a smart card key.

NameDescription
System_CAPS_pubpropertyCryptoKeySecurity

Gets or sets a CryptoKeySecurity object that represents access rights and audit rules for a container.

System_CAPS_pubpropertyFlags

Represents the flags for CspParameters that modify the behavior of the cryptographic service provider (CSP).

System_CAPS_pubpropertyKeyPassword

Gets or sets a password associated with a smart card key.

System_CAPS_pubpropertyParentWindowHandle

Gets or sets a handle to the unmanaged parent window for a smart card password dialog box.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubfieldKeyContainerName

Represents the key container name for CspParameters.

System_CAPS_pubfieldKeyNumber

Specifies whether an asymmetric key is created as a signature key or an exchange key.

System_CAPS_pubfieldProviderName

Represents the provider name for CspParameters.

System_CAPS_pubfieldProviderType

Represents the provider type code for CspParameters.

The CspParameters class represents parameters that you can pass to managed cryptography classes that internally use Microsoft Cryptographic Service Providers (CSPs) from the unmanaged Microsoft Cryptography API (CAPI). Classes with names ending in "CryptoServiceProvider" are managed code wrappers for the corresponding CSP.

Use the CspParameters class to do the following:

  • Specify a particular CSP by passing the provider type to the ProviderType or ProviderName property. You can also specify a CSP using an overload of the constructor.

  • Create a key container where you can store cryptographic keys. Key containers provide the most secure way to persist cryptographic keys and keep them secret from malicious third parties. For more information about creating key containers, see How to: Store Asymmetric Keys in a Key Container.

  • Specify whether to create an asymmetric signature key or an asymmetric exchange key using the KeyNumber property.

The following code example creates a key container using the CspParameters class and saves the key in the container.

No code example is currently available or this language may not be supported.

The following code example uses the CspParameters class to select a Smart Card Cryptographic Service Provider. It then signs and verifies data using the smart card.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Windows Phone Silverlight
Available since 7.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: