Documentation ¶
Index ¶
- func GetRegistrationEntries(fileName string) []*common.RegistrationEntry
- func GetRegistrationEntriesMap(fileName string) map[string][]*common.RegistrationEntry
- func LoadBundle(path string) ([]*x509.Certificate, error)
- func LoadBundleFixture() ([]*x509.Certificate, error)
- func LoadCAFixture() (ca *x509.Certificate, key *ecdsa.PrivateKey, err error)
- func LoadCert(path string) (*x509.Certificate, error)
- func LoadCertAndKey(crtPath, keyPath string) (*x509.Certificate, *ecdsa.PrivateKey, error)
- func LoadKey(path string) (*ecdsa.PrivateKey, error)
- func LoadPEM(path string) (*pem.Block, error)
- func LoadSVIDFixture() (svid *x509.Certificate, key *ecdsa.PrivateKey, err error)
- func NewCATemplate(clk clock.Clock, trustDomain spiffeid.TrustDomain) (*x509.Certificate, error)
- func NewCSRTemplate(spiffeID string) ([]byte, crypto.PublicKey, error)
- func NewCSRTemplateWithKey(spiffeID string, key crypto.Signer) ([]byte, error)
- func NewSVIDTemplate(clk clock.Clock, spiffeID string) (*x509.Certificate, error)
- func NewSVIDTemplateFromCSR(clk clock.Clock, csr []byte, ca *x509.Certificate, ttl int) (*x509.Certificate, error)
- func ProjectRoot() string
- func RaceTest(t *testing.T, fn func(*testing.T))
- func RunWithTimeout(t *testing.T, timeout time.Duration, code func()) time.Duration
- func SelfSign(req *x509.Certificate) (*x509.Certificate, *ecdsa.PrivateKey, error)
- func Sign(req, parent *x509.Certificate, signerPrivateKey any) (*x509.Certificate, *ecdsa.PrivateKey, error)
- type OutputRedirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRegistrationEntries ¶
func GetRegistrationEntries(fileName string) []*common.RegistrationEntry
GetRegistrationEntries gets registration entries from a fixture
func GetRegistrationEntriesMap ¶
func GetRegistrationEntriesMap(fileName string) map[string][]*common.RegistrationEntry
GetRegistrationEntriesMap gets a map of registration entries from a fixture
func LoadBundle ¶
func LoadBundle(path string) ([]*x509.Certificate, error)
func LoadBundleFixture ¶
func LoadBundleFixture() ([]*x509.Certificate, error)
func LoadCAFixture ¶
func LoadCAFixture() (ca *x509.Certificate, key *ecdsa.PrivateKey, err error)
LoadCAFixture reads, parses, and returns the pre-defined CA fixture and key
func LoadCert ¶
func LoadCert(path string) (*x509.Certificate, error)
LoadCert reads and parses an X.509 certificate at the specified path
func LoadCertAndKey ¶
func LoadCertAndKey(crtPath, keyPath string) (*x509.Certificate, *ecdsa.PrivateKey, error)
LoadCertAndKey reads and parses both a certificate and a private key at once
func LoadKey ¶
func LoadKey(path string) (*ecdsa.PrivateKey, error)
LoadKey reads and parses the ECDSA private key at the specified path
func LoadSVIDFixture ¶
func LoadSVIDFixture() (svid *x509.Certificate, key *ecdsa.PrivateKey, err error)
LoadSVIDFixture reads, parses, and returns the pre-defined SVID fixture and key
func NewCATemplate ¶
func NewCATemplate(clk clock.Clock, trustDomain spiffeid.TrustDomain) (*x509.Certificate, error)
NewCATemplate returns a default CA template with the specified trust domain. Must be signed before it's valid.
func NewCSRTemplate ¶
NewCSRTemplate returns a default CSR template with the specified SPIFFE ID.
func NewCSRTemplateWithKey ¶ added in v1.0.0
func NewSVIDTemplate ¶
NewSVIDTemplate returns a default SVID template with the specified SPIFFE ID. Must be signed before it's valid.
func NewSVIDTemplateFromCSR ¶
func NewSVIDTemplateFromCSR(clk clock.Clock, csr []byte, ca *x509.Certificate, ttl int) (*x509.Certificate, error)
func ProjectRoot ¶
func ProjectRoot() string
ProjectRoot returns the absolute path to the SPIRE project root
func RunWithTimeout ¶
RunWithTimeout runs code within the specified timeout, if execution takes longer than that, an error is logged to t with information about the caller of this function. Returns how much time it took to run the function.
func SelfSign ¶
func SelfSign(req *x509.Certificate) (*x509.Certificate, *ecdsa.PrivateKey, error)
SelfSign creates a new self-signed certificate with the provided template.
func Sign ¶
func Sign(req, parent *x509.Certificate, signerPrivateKey any) (*x509.Certificate, *ecdsa.PrivateKey, error)
Sign creates a new certificate based on the provided template and signed using parent certificate and signerPrivateKey.
Types ¶
type OutputRedirection ¶
type OutputRedirection struct {
// contains filtered or unexported fields
}
func (*OutputRedirection) Finish ¶
func (redirector *OutputRedirection) Finish() (string, error)