Standard library / crypto/x509
crypto/x509.ExtKeyUsage
Enumerated permitted purposes; use a slice in certificate and verification options, not a bitmask. Expected stdout: '1\n'.
Formal Syntax & Structure
go syntaxgo
type ExtKeyUsage intWorking Example
Example Snippetgo
package main
import ( "crypto/x509" "fmt")
func main() { u := []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}; fmt.Println(len(u)) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}