mock

package
v0.0.0-...-8f21e7d Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAClient

type CAClient struct {
	SignInvokeCount uint64

	GeneratedCerts [][]string // Cache the generated certificates for verification purpose.
	// contains filtered or unexported fields
}

CAClient is the mocked CAClient for testing.

func NewMockCAClient

func NewMockCAClient(certLifetime time.Duration, mockTrustAnchor bool) (*CAClient, error)

NewMockCAClient creates an instance of CAClient. errors is used to specify the number of errors before CSRSign returns a valid response. certLifetime specifies the TTL for the newly issued workload cert.

func (*CAClient) CSRSign

func (c *CAClient) CSRSign(csrPEM []byte, certValidTTLInSec int64) ([]string, error)

CSRSign returns the certificate or errors depending on the settings.

func (*CAClient) Close

func (c *CAClient) Close()

func (*CAClient) GetRootCertBundle

func (c *CAClient) GetRootCertBundle() ([]string, error)

Jump to

Keyboard shortcuts

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