Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCACertificate

func CreateCACertificate(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, options ...CertificateOption) (*x509.Certificate, crypto.Signer)

func CreateCertificate

func CreateCertificate(tb testing.TB, tmpl, parent *x509.Certificate, pub, priv interface{}) *x509.Certificate

func CreateWebCredentials

func CreateWebCredentials(t testing.TB) (*x509.CertPool, *tls.Certificate)

func CreateX509Certificate

func CreateX509Certificate(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, options ...CertificateOption) (*x509.Certificate, crypto.Signer)

func CreateX509SVID

func CreateX509SVID(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, id spiffeid.ID, options ...CertificateOption) (*x509.Certificate, crypto.Signer)

func NewEC256Key

func NewEC256Key(tb testing.TB) *ecdsa.PrivateKey

NewEC256Key returns an ECDSA key over the P256 curve

func NewKeyID

func NewKeyID(tb testing.TB) string

NewKeyID returns a random id useful for identifying keys

func NewSerial

func NewSerial(tb testing.TB) *big.Int

Types

type CA

type CA struct {
	// contains filtered or unexported fields
}

func NewCA

func NewCA(tb testing.TB, td spiffeid.TrustDomain) *CA

func (*CA) Bundle

func (ca *CA) Bundle() *spiffebundle.Bundle

func (*CA) ChildCA

func (ca *CA) ChildCA(options ...CertificateOption) *CA

func (*CA) CreateJWTSVID

func (ca *CA) CreateJWTSVID(id spiffeid.ID, audience []string) *jwtsvid.SVID

func (*CA) CreateX509Certificate

func (ca *CA) CreateX509Certificate(options ...CertificateOption) ([]*x509.Certificate, crypto.Signer)

func (*CA) CreateX509SVID

func (ca *CA) CreateX509SVID(id spiffeid.ID, options ...CertificateOption) *x509svid.SVID

func (*CA) JWTAuthorities

func (ca *CA) JWTAuthorities() map[string]crypto.PublicKey

func (*CA) JWTBundle

func (ca *CA) JWTBundle() *jwtbundle.Bundle

func (*CA) X509Authorities

func (ca *CA) X509Authorities() []*x509.Certificate

func (*CA) X509Bundle

func (ca *CA) X509Bundle() *x509bundle.Bundle

type CertificateOption

type CertificateOption interface {
	// contains filtered or unexported methods
}

func WithIPAddresses

func WithIPAddresses(ips ...net.IP) CertificateOption

func WithKeyUsage

func WithKeyUsage(keyUsage x509.KeyUsage) CertificateOption

func WithLifetime

func WithLifetime(notBefore, notAfter time.Time) CertificateOption

func WithSerial

func WithSerial(serial *big.Int) CertificateOption

func WithSubject

func WithSubject(subject pkix.Name) CertificateOption

func WithURIs

func WithURIs(uris ...*url.URL) CertificateOption

Directories

Path Synopsis
OS specific error strings
OS specific error strings

Jump to

Keyboard shortcuts

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