code: func GetExtFromCert(cert *x509.Certificate, oid asn1.ObjectIdentifier) *pkix.Extension {
  	for i := range cert.Extensions {
  		if oid.Equal(cert.Extensions[i].Id) {
  			return &(cert.Extensions[i])
  		}
  	}
  	return nil
  }
docs: // GetExtFromCert returns the extension with the matching OID, if present. If
  // the extension if not present, it returns nil.