System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter.SetKey C# (CSharp) Method

SetKey() public method

public SetKey ( AsymmetricAlgorithm key ) : void
key AsymmetricAlgorithm
return void
        public override void SetKey(AsymmetricAlgorithm key)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            _rsaKey = (RSA)key;
        }

Usage Example

	public void Properties () 
	{
		RSAPKCS1KeyExchangeDeformatter keyex = new RSAPKCS1KeyExchangeDeformatter ();
		keyex.SetKey (key);
		Assert.IsNull (keyex.Parameters, "RSAPKCS1KeyExchangeDeformatter.Parameters");
		// null (default)
		Assert.IsNull (keyex.RNG, "RSAPKCS1KeyExchangeDeformatter.RNG");
		Assert.AreEqual("System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter", keyex.ToString ());
	}