Automatak.Simulator.DNP3.TLSOptionsControl.ValidateConfig C# (CSharp) Method

ValidateConfig() private method

private ValidateConfig ( TLSConfig config ) : void
config TLSConfig
return void
        private void ValidateConfig(TLSConfig config)
        {
            if (string.IsNullOrWhiteSpace(config.peerCertFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.peerCertFilePath)))
            {
                throw new Exception("Invalid Trusted Certificate File Path");
            }

            if (string.IsNullOrWhiteSpace(config.localCertFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.localCertFilePath)))
            {
                throw new Exception("Invalid Certificate File Path");
            }

            if (string.IsNullOrWhiteSpace(config.privateKeyFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.privateKeyFilePath)))
            {
                throw new Exception("Invalid Private Key File Path");
            }

            if (!(config.allowTLSv10 || config.allowTLSv11 || config.allowTLSv12))
            {
                throw new Exception("At least one TLS version must be selected");
            }
        }