internal static void PrintSslInfo(SslStream stream, TcpConnection.Logger logger) { logger("Cipher: " + stream.CipherAlgorithm + " strength: " + stream.CipherStrength); logger("Hash: " + stream.HashAlgorithm + " strength: " + stream.HashStrength); logger("Key exchange: " + stream.KeyExchangeAlgorithm + " strength: " + stream.KeyExchangeStrength); logger("Protocol version: " + stream.SslProtocol); }
internal static X509Certificate LoadServerCertificate(string certificatePath, bool printInfo, TcpConnection.Logger logger) { X509Certificate serverCertificateObject = new X509Certificate(); serverCertificateObject.Import(File.ReadAllBytes(certificatePath)); if (printInfo) { logger("server public key string for certificate named: " + certificatePath); logger(serverCertificateObject.GetPublicKeyString()); } return(serverCertificateObject); }