Beispiel #1
0
 internal static bool CheckCnIsFQDN(string subjectName)
 {
     if (string.IsNullOrEmpty(subjectName))
     {
         return(false);
     }
     char[] separator = new char[]
     {
         ','
     };
     char[] separator2 = new char[]
     {
         '='
     };
     string[] array = subjectName.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     foreach (string text in array)
     {
         string[] array3 = text.Split(separator2, StringSplitOptions.RemoveEmptyEntries);
         if (array3.Length == 2 && array3[0].Trim().Equals("CN", StringComparison.OrdinalIgnoreCase))
         {
             string text2 = array3[1].Trim();
             if (!string.IsNullOrEmpty(text2) && (Dns.IsValidName(text2) || (Dns.IsValidWildcardName(text2) && text2.Length > 2)))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
 private static bool IsValidProtocolCertificate(string certificateName)
 {
     return(Dns.IsValidName(certificateName));
 }
Beispiel #3
0
 internal static bool IsDomainValidForCertificate(string domain)
 {
     return(Dns.IsValidName(domain) || Dns.IsValidWildcardName(domain));
 }