func isCertificateLifetimeValid()

in codelabs/health_data_analysis_codelab/src/uwear/workload.go [270:283]


func isCertificateLifetimeValid(certificate *x509.Certificate) bool {
	currentTime := time.Now()
	// check the current time is after the certificate NotBefore time
	if !currentTime.After(certificate.NotBefore) {
		return false
	}

	// check the current time is before the certificate NotAfter time
	if currentTime.Before(certificate.NotAfter) {
		return false
	}

	return true
}