package test
import "github.com/spiffe/go-spiffe/v2/internal/test"
Index ¶
- func CreateCACertificate(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, options ...CertificateOption) (*x509.Certificate, crypto.Signer)
- func CreateCertificate(tb testing.TB, tmpl, parent *x509.Certificate, pub, priv interface{}) *x509.Certificate
- func CreateWebCredentials(t testing.TB) (*x509.CertPool, *tls.Certificate)
- func CreateX509Certificate(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, options ...CertificateOption) (*x509.Certificate, crypto.Signer)
- func CreateX509SVID(tb testing.TB, parent *x509.Certificate, parentKey crypto.Signer, spiffeID string, options ...CertificateOption) (*x509.Certificate, crypto.Signer)
- func NewEC256Key(tb testing.TB) *ecdsa.PrivateKey
- func NewSerial(tb testing.TB) *big.Int
- type CA
- func NewCA(tb testing.TB, options ...CertificateOption) *CA
- func (ca *CA) Bundle(td spiffeid.TrustDomain) *x509bundle.Bundle
- func (ca *CA) ChildCA(options ...CertificateOption) *CA
- func (ca *CA) CreateJWTSVID(spiffeID string, audience []string) string
- func (ca *CA) CreateX509SVID(spiffeID string, options ...CertificateOption) ([]*x509.Certificate, crypto.Signer)
- func (ca *CA) PublicKey() crypto.PublicKey
- func (ca *CA) Roots() []*x509.Certificate
- type CertificateOption
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 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, spiffeID string, 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 NewSerial ¶
Types ¶
type CA ¶
type CA struct {
// contains filtered or unexported fields
}
func NewCA ¶
func NewCA(tb testing.TB, options ...CertificateOption) *CA
func (*CA) Bundle ¶
func (ca *CA) Bundle(td spiffeid.TrustDomain) *x509bundle.Bundle
func (*CA) ChildCA ¶
func (ca *CA) ChildCA(options ...CertificateOption) *CA
func (*CA) CreateJWTSVID ¶
func (*CA) CreateX509SVID ¶
func (ca *CA) CreateX509SVID(spiffeID string, options ...CertificateOption) ([]*x509.Certificate, crypto.Signer)
func (*CA) PublicKey ¶
func (*CA) Roots ¶
func (ca *CA) Roots() []*x509.Certificate
type CertificateOption ¶
type CertificateOption interface {
// contains filtered or unexported methods
}
func WithIPAddresses ¶
func WithIPAddresses(ips []net.IP) 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
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal/test/fakebundleendpoint | |
internal/test/fakeworkloadapi |
- Version
- v2.0.0-alpha.2
- Published
- Apr 23, 2020
- Platform
- js/wasm
- Imports
- 20 packages
- Last checked
- 21 hours ago –
Tools for package owners.