<PackageReference Include="SSH.NET" Version="2016.1.0-beta1" />

CryptoAbstraction

static class CryptoAbstraction
using Renci.SshNet.Security.Cryptography; using SshNet.Security.Cryptography; using System.Security.Cryptography; namespace Renci.SshNet.Abstractions { internal static class CryptoAbstraction { private static readonly RandomNumberGenerator Randomizer = CreateRandomNumberGenerator(); public static void GenerateRandom(byte[] data) { Randomizer.GetBytes(data); } public static RandomNumberGenerator CreateRandomNumberGenerator() { return RandomNumberGenerator.Create(); } public static System.Security.Cryptography.MD5 CreateMD5() { return System.Security.Cryptography.MD5.Create(); } public static System.Security.Cryptography.SHA1 CreateSHA1() { return System.Security.Cryptography.SHA1.Create(); } public static System.Security.Cryptography.SHA256 CreateSHA256() { return System.Security.Cryptography.SHA256.Create(); } public static System.Security.Cryptography.SHA384 CreateSHA384() { return System.Security.Cryptography.SHA384.Create(); } public static System.Security.Cryptography.SHA512 CreateSHA512() { return System.Security.Cryptography.SHA512.Create(); } public static RIPEMD160 CreateRIPEMD160() { return new RIPEMD160(); } public static System.Security.Cryptography.HMACMD5 CreateHMACMD5(byte[] key) { return new System.Security.Cryptography.HMACMD5(key); } public static Renci.SshNet.Security.Cryptography.HMACMD5 CreateHMACMD5(byte[] key, int hashSize) { return new Renci.SshNet.Security.Cryptography.HMACMD5(key, hashSize); } public static System.Security.Cryptography.HMACSHA1 CreateHMACSHA1(byte[] key) { return new System.Security.Cryptography.HMACSHA1(key); } public static Renci.SshNet.Security.Cryptography.HMACSHA1 CreateHMACSHA1(byte[] key, int hashSize) { return new Renci.SshNet.Security.Cryptography.HMACSHA1(key, hashSize); } public static System.Security.Cryptography.HMACSHA256 CreateHMACSHA256(byte[] key) { return new System.Security.Cryptography.HMACSHA256(key); } public static Renci.SshNet.Security.Cryptography.HMACSHA256 CreateHMACSHA256(byte[] key, int hashSize) { return new Renci.SshNet.Security.Cryptography.HMACSHA256(key, hashSize); } public static System.Security.Cryptography.HMACSHA384 CreateHMACSHA384(byte[] key) { return new System.Security.Cryptography.HMACSHA384(key); } public static Renci.SshNet.Security.Cryptography.HMACSHA384 CreateHMACSHA384(byte[] key, int hashSize) { return new Renci.SshNet.Security.Cryptography.HMACSHA384(key, hashSize); } public static System.Security.Cryptography.HMACSHA512 CreateHMACSHA512(byte[] key) { return new System.Security.Cryptography.HMACSHA512(key); } public static Renci.SshNet.Security.Cryptography.HMACSHA512 CreateHMACSHA512(byte[] key, int hashSize) { return new Renci.SshNet.Security.Cryptography.HMACSHA512(key, hashSize); } public static HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key) { return new HMACRIPEMD160(key); } } }