Standard library / crypto/x509/pkix
crypto/x509/pkix.RevokedCertificate
Legacy CRL entry with SerialNumber, RevocationTime and Extensions. Prefer x509.RevocationListEntry. Expected stdout: '7\n'.
Formal Syntax & Structure
go syntaxgo
type RevokedCertificate struct { SerialNumber *big.Int RevocationTime time.Time Extensions []Extension `asn1:"optional"`}Working Example
Example Snippetgo
package main
import ( "crypto/x509/pkix" "fmt" "math/big" "time")
func main() { // Historical interoperability demonstration only. Prefer modern protocols for new designs. r := pkix.RevokedCertificate{SerialNumber: big.NewInt(7), RevocationTime: time.Unix(100, 0)} fmt.Println(r.SerialNumber.Int64())}
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) }}