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); } }
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); }