Пример #1
0
        public CertificateHostName(string hostName)
        {
            this.HostName = hostName._NonNullTrim();

            this.Type = CertificateHostnameType.SingleHost;

            if (hostName.StartsWith("*.") || HostName == "*")
            {
                this.Type = CertificateHostnameType.Wildcard;

                this.WildcardEndWith = hostName.Substring(1);
            }
        }
Пример #2
0
        public bool IsMatchForHost(string hostname, out CertificateHostnameType matchType)
        {
            foreach (var cn in this.HostNameList)
            {
                if (cn.IsMatchForHost(hostname))
                {
                    matchType = cn.Type;
                    return(true);
                }
            }

            matchType = CertificateHostnameType.SingleHost;
            return(false);
        }