bundle

package
v1.16.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultKeyThumbprintAlgorithm
	DefaultKeyThumbprintAlgorithm = crypto.SHA256
	// DefaultJWTSignatureAlgorithm is set to RS256 by default as it is the most compatible algorithm.
	DefaultJWTSignatureAlgorithm = jwa.RS256
)

Variables

This section is empty.

Functions

func GenerateWorkloadCert

func GenerateWorkloadCert(sig x509.SignatureAlgorithm, ttl, skew time.Duration, id *spiffe.Parsed) (*x509.Certificate, error)

GenerateWorkloadCert returns a CA issuing x509 Certificate.

Types

type Bundle

type Bundle struct {
	X509 X509
	JWT  JWT
}

Bundle is the bundle of certificates and keys used by the CA.

func Generate

func Generate(opts GenerateOptions) (Bundle, error)

Generate generates the x.509 and JWT bundles if required.

type GenerateOptions

type GenerateOptions struct {
	X509RootKey        crypto.Signer
	JWTRootKey         crypto.Signer
	TrustDomain        string
	AllowedClockSkew   time.Duration
	OverrideCATTL      *time.Duration // Optional override for CA TTL
	MissingCredentials MissingCredentials
}

type JWT

type JWT struct {
	// SigningKey is the private key used to sign JWTs.
	SigningKey crypto.Signer
	// SigningKeyPEM is the PEM encoded private key used to sign JWTs.
	SigningKeyPEM []byte
	// JWKS is the JWK set used to verify JWTs.
	JWKS jwk.Set
	// JWKSJson is the JSON encoded JWK set used to verify JWTs.
	JWKSJson []byte
}

type MissingCredentials

type MissingCredentials struct {
	// X509 indicates whether we need to generate X.509 certificates.
	X509 bool
	// JWT indicates whether we need to generate JWT signing keys.
	JWT bool
}

MissingCredentials represents the type of credentials that require generation.

func (*MissingCredentials) MissingRootKeys

func (g *MissingCredentials) MissingRootKeys() bool

type X509

type X509 struct {
	// TrustAnchors is the PEM encoded trust anchors.
	TrustAnchors []byte
	// IssChainPEM is the PEM encoded issuer certificate chain.
	IssChainPEM []byte
	// IssKeyPEM is the PEM encoded issuer private key.
	IssKeyPEM []byte
	// IssChain is the issuer certificate chain.
	IssChain []*x509.Certificate
	// IssKey is the issuer private key.
	IssKey any
}

Jump to

Keyboard shortcuts

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