IsExpiring check if the certificate will expire in the configured duration
()
| 324 | |
| 325 | // IsExpiring check if the certificate will expire in the configured duration |
| 326 | func (pair *KeyPair) IsExpiring() (bool, *time.Time, error) { |
| 327 | cert, err := pair.ParseCertificate() |
| 328 | if err != nil { |
| 329 | return true, nil, err |
| 330 | } |
| 331 | |
| 332 | if time.Now().Before(cert.NotBefore) { |
| 333 | return true, &cert.NotAfter, nil |
| 334 | } |
| 335 | expiringCheckThreshold := getCheckThreshold() |
| 336 | if time.Now().Add(expiringCheckThreshold).After(cert.NotAfter) { |
| 337 | return true, &cert.NotAfter, nil |
| 338 | } |
| 339 | |
| 340 | return false, &cert.NotAfter, nil |
| 341 | } |
| 342 | |
| 343 | // DoAltDNSNamesMatch checks if the certificate has all of the specified altDNSNames |
| 344 | func (pair *KeyPair) DoAltDNSNamesMatch(altDNSNames []string) (bool, error) { |
no test coverage detected