RSACng RSACng RSACng RSACng Constructors

Definition

Overloads

RSACng() RSACng() RSACng()

Initializes a new instance of the RSACng class with a random 2,048-bit key pair.

RSACng(Int32) RSACng(Int32) RSACng(Int32) RSACng(Int32)

Initializes a new instance of the RSACng class with a randomly generated key of the specified size.

RSACng(CngKey) RSACng(CngKey) RSACng(CngKey) RSACng(CngKey)

Initializes a new instance of the RSACng class with the specified key.

RSACng() RSACng() RSACng()

Initializes a new instance of the RSACng class with a random 2,048-bit key pair.

public:
 RSACng();
public RSACng ();
Public Sub New ()

RSACng(Int32) RSACng(Int32) RSACng(Int32) RSACng(Int32)

Initializes a new instance of the RSACng class with a randomly generated key of the specified size.

public:
 RSACng(int keySize);
public RSACng (int keySize);
new System.Security.Cryptography.RSACng : int -> System.Security.Cryptography.RSACng
Public Sub New (keySize As Integer)

Parameters

keySize
Int32 Int32 Int32 Int32

The size of the key to generate in bits.

Exceptions

Remarks

Valid key sizes range from 384 to 16,384 bits, in increments of 8. We recommend that a minimum size of 2,048 bits be used for all keys.

RSACng(CngKey) RSACng(CngKey) RSACng(CngKey) RSACng(CngKey)

Initializes a new instance of the RSACng class with the specified key.

public:
 RSACng(System::Security::Cryptography::CngKey ^ key);
public RSACng (System.Security.Cryptography.CngKey key);
new System.Security.Cryptography.RSACng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.RSACng
Public Sub New (key As CngKey)

Parameters

key
CngKey CngKey CngKey CngKey

The key to use for RSA operations.

Exceptions

Remarks

The CngKey.AlgorithmGroup of key must be CngAlgorithmGroup.Rsa.

This constructor creates a copy of the key. Even if key is disposed, the copy of this key object in RSA remains alive.

Applies to