func LeafHasDNSNames(leaf Leaf, dnsNames []string) bool {
	certDNSNames := leaf.Certificate().DNSNames
	if len(certDNSNames) < len(dnsNames) {
		return false
	}

	a := make([]string, len(certDNSNames))
	copy(a, certDNSNames)
	sort.Strings(a)
	sort.Strings(dnsNames)

	for _, name := range dnsNames {
		index := sort.SearchStrings(a, name)
		if index == len(a) || a[index] != name {
			return false
		}
	}
	return true
}
// LeafHasDNSNames tests a diven Leaf to see if it contains the supplied DNS
// names
LeafHasDNSNames tests a diven Leaf to see if it contains the supplied DNS
names
// LeafHasDNSNames tests a diven Leaf to see if it contains the supplied DNS // names
func LeafHasDNSNames(leaf Leaf, dnsNames []string) bool {
	certDNSNames := leaf.Certificate().DNSNames
	if len(certDNSNames) < len(dnsNames) {
		return false
	}
	a := make([]string, len(certDNSNames))
	copy(a, certDNSNames)
	sort.Strings(a)
	sort.Strings(dnsNames)
	for _, name := range dnsNames {
		index := sort.SearchStrings(a, name)
		if index == len(a) || a[index] != name {
			return false
		}
	}
	return true
}
func LeafHasDNSNames ( leaf Leaf , dnsNames [ ] string ) bool { certDNSNames := leaf . Certificate ( ) . DNSNames if len ( certDNSNames ) < len ( dnsNames ) { return false } a := make ( [ ] string , len ( certDNSNames ) ) copy ( a , certDNSNames ) sort . Strings ( a ) sort . Strings ( dnsNames ) for _ , name := range dnsNames { index := sort . SearchStrings ( a , name ) if index == len ( a ) || a [ index ] != name { return false } } return true }
LeafHasDNSNames tests a diven Leaf to see if it contains the supplied DNS
names
LeafHasDNSNames tests a diven Leaf to see if it contains the supplied DNS names