CspParameters Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptographic computations. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
The CspParameters type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | CspParameters() | Initializes a new instance of the CspParameters class. |
![]() | CspParameters(Int32) | Initializes a new instance of the CspParameters class with the specified provider type code. |
![]() | CspParameters(Int32, String) | Initializes a new instance of the CspParameters class with the specified provider type code and name. |
![]() | CspParameters(Int32, String, String) | Initializes a new instance of the CspParameters class with the specified provider type code and name, and the specified container name. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | KeyContainerName | Represents the key container name for CspParameters. |
![]() | KeyNumber | Specifies whether an asymmetric key is created as a signature key or an exchange key. |
![]() | ProviderName | Represents the provider name for CspParameters. |
![]() | ProviderType | 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.
Specify whether to create an asymmetric signature key or an asymmetric exchange key using the KeyNumber property.
| Topic | Location |
|---|---|
| How to: Store Asymmetric Keys in a Key Container | .NET Framework: Security |
| How to: Encrypt XML Elements with Asymmetric Keys | .NET Framework: Security |
| How to: Decrypt XML Elements with Asymmetric Keys | .NET Framework: Security |
| How to: Store Asymmetric Keys in a Key Container | .NET Framework: Security |
| How to: Encrypt XML Elements with Asymmetric Keys | .NET Framework: Security |
| How to: Decrypt XML Elements with Asymmetric Keys | .NET Framework: Security |



