Documentation
¶
Overview ¶
Package spiffecert reads SPIFFE identities out of X.509 certificates using go-spiffe's x509svid rules: a certificate carries exactly one URI SAN and it must be a valid SPIFFE ID.
It lives apart from pkg/identity so that foundational package keeps its single go-spiffe dependency (spiffeid). Certificate-handling code that wants the fuller x509svid behavior imports this package instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasID ¶
func HasID(cert *x509.Certificate, want string) bool
HasID reports whether cert's SPIFFE ID equals want. want must itself be a valid SPIFFE ID and cert must have exactly one URI SAN; any other input reports false, so a misconfigured pin or a certificate with extra URI SANs fails closed.
func IDFromCertificate ¶
func IDFromCertificate(cert *x509.Certificate) (spiffeid.ID, error)
IDFromCertificate returns the SPIFFE ID of cert. It fails unless the certificate has exactly one URI SAN that is a valid SPIFFE ID.
Types ¶
This section is empty.