Add a comment to GetCertExpiration

This commit is contained in:
xenolf 2015-10-17 22:27:04 +02:00
parent 34910bd541
commit 3ef08f7413

View file

@ -34,6 +34,7 @@ func pemEncode(data interface{}) []byte {
return pem.EncodeToMemory(pemBlock) return pem.EncodeToMemory(pemBlock)
} }
// GetCertExpiration returns the "NotAfter" date of a DER encoded certificate.
func GetCertExpiration(cert []byte) (time.Time, error) { func GetCertExpiration(cert []byte) (time.Time, error) {
pCert, err := x509.ParseCertificate(cert) pCert, err := x509.ParseCertificate(cert)
if err != nil { if err != nil {