MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / DoAltDNSNamesMatch

Method DoAltDNSNamesMatch

pkg/certs/certs.go:344–354  ·  view source on GitHub ↗

DoAltDNSNamesMatch checks if the certificate has all of the specified altDNSNames

(altDNSNames []string)

Source from the content-addressed store, hash-verified

342
343// DoAltDNSNamesMatch checks if the certificate has all of the specified altDNSNames
344func (pair *KeyPair) DoAltDNSNamesMatch(altDNSNames []string) (bool, error) {
345 cert, err := pair.ParseCertificate()
346 if err != nil {
347 return false, err
348 }
349
350 sort.Strings(cert.DNSNames)
351 sort.Strings(altDNSNames)
352
353 return slices.Equal(cert.DNSNames, altDNSNames), nil
354}
355
356// CreateDerivedCA create a new CA derived from the certificate in the
357// keypair

Callers 2

RenewLeafCertificateFunction · 0.80
certs_test.goFile · 0.80

Calls 1

ParseCertificateMethod · 0.95

Tested by

no test coverage detected