using System; using System.Linq; using Renci.SshNet.Security.Cryptography; namespace Renci.SshNet { /// /// Holds information about key size and cipher to use /// public class CipherInfo { /// /// Gets the size of the key. /// /// /// The size of the key. /// public int KeySize { get; private set; } /// /// Gets the cipher. /// public Func Cipher { get; private set; } /// /// Initializes a new instance of the class. /// /// Size of the key. /// The cipher. public CipherInfo(int keySize, Func cipher) { this.KeySize = keySize; this.Cipher = (key, iv) => (cipher(key.Take(this.KeySize / 8).ToArray(), iv)); } } }