spiffecert

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL