Golang crypto/x509/pkix.CertificateList type and HasExpired() function example
package crypto/x509/pkix
CertificateList represents the ASN.1 structure of the same name. See RFC 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the signature.
Golang crypto/x509/pkix.CertificateList type and HasExpired() function usage example
certList, err := x509.ParseDERCRL([]byte(crlBytes))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("TBSCertList : %v\n\n", certList.TBSCertList)
fmt.Printf("SignatureAlgorithm : %v\n\n", certList.SignatureAlgorithm)
fmt.Printf("SignatureValue : %v\n\n", certList.SignatureValue)
and
if certList.HasExpired(time.Unix(1302517272, 0)) {
fmt.Println("CRL has expired!")
}
Reference :
https://www.socketloop.com/references/golang-crypto-x509-parsedercrl-function-example
Advertisement
Something interesting
Tutorials
+16.3k Golang : How to extract links from web page ?
+8.9k Golang : What is the default port number for connecting to MySQL/MariaDB database ?
+19.9k Golang : Measure http.Get() execution time
+5.9k Golang : Extract unicode string from another unicode string example
+6.6k Golang : Embedded or data bundling example
+31.9k Golang : Convert an image file to []byte
+30.4k Golang : How to redirect to new page with net/http?
+14.6k Golang : Reset buffer example
+13.8k Golang : unknown escape sequence error
+5.8k Cash Flow : 50 days to pay your credit card debt
+16.8k Golang : Get own process identifier
+9.7k Golang : Eroding and dilating image with OpenCV example