Renci.SshNet.Security.Cryptography.Ciphers.AesCipher.AesCipher C# (CSharp) Method

AesCipher() public method

Initializes a new instance of the AesCipher class.
is null. Keysize is not valid for this algorithm.
public AesCipher ( byte key, CipherMode mode, CipherPadding padding ) : System
key byte The key.
mode CipherMode The mode.
padding CipherPadding The padding.
return System
        public AesCipher(byte[] key, CipherMode mode, CipherPadding padding)
            : base(key, 16, mode, padding)
        {
            var keySize = key.Length * 8;

            if (!(keySize == 256 || keySize == 192 || keySize == 128))
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "KeySize '{0}' is not valid for this algorithm.", keySize));
        }