Golang crypto/x509.VerifyOptions type example

package crypto/x509

Golang crypto/x509.VerifyOptions type usage example

 certpool := x509.NewCertPool()

 cert.VerifyHostname("example.com")
 _, err = cert.Verify(x509.VerifyOptions{
 DNSName: "example.com",
 Roots: certpool,
 })

Reference :

http://golang.org/pkg/crypto/x509/#VerifyOptions

Advertisement