RSACng::ImportParameters Method (RSAParameters)

.NET Framework (current version)
 

Replaces the existing key that the current instance is working with by creating a new CngKey for the parameters structure.

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

public:
virtual void ImportParameters(
	RSAParameters parameters
) override

Parameters

parameters
Type: System.Security.Cryptography::RSAParameters

The RSA parameters.

Exception Condition
ArgumentException

parameters contains neither an exponent nor a modulus.

CryptographicException

parameters is not a valid RSA key.

-or-

parameters is a full key pair and the default KSP is used.

If parameters contains only an exponent and modulus, only a public key is imported. If parameters also contains P and Q values, a full key pair is imported.

.NET Framework
Available since 4.6
Return to top
Show: