System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.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 () 
		{
			RSAOAEPKeyExchangeFormatter keyex = new RSAOAEPKeyExchangeFormatter ();
			keyex.SetKey (key);
			Assert.IsNull (keyex.Parameter, "RSAOAEPKeyExchangeFormatter.Parameter");
			Assert.IsNull (keyex.Parameters, "RSAOAEPKeyExchangeFormatter.Parameters");
			Assert.IsNull (keyex.Rng, "RSAOAEPKeyExchangeFormatter.Rng");
			Assert.AreEqual ("System.Security.Cryptography.RSAOAEPKeyExchangeFormatter", keyex.ToString ());
		}
All Usage Examples Of System.Security.Cryptography.RSAOAEPKeyExchangeFormatter::SetKey