RSACryptoServiceProvider Constructor (Int32)

RSACryptoServiceProvider Constructor (Int32)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Initializes a new instance of the RSACryptoServiceProvider class with the specified key size.

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

public RSACryptoServiceProvider(
	int dwKeySize


Type: System.Int32
The size of the key to use in bits.


The cryptographic service provider (CSP) cannot be acquired.

If no default key is found, a new key is created.

This constructor creates an Exchange key pair suitable to encrypt session keys so that they can be safely stored and exchanged with other users. The generated key corresponds to a key generated using the AT_KEYEXCHANGE value used in the unmanaged Microsoft Cryptographic API (CAPI).

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2018 Microsoft