testing

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCertificates

func DefaultCertificates() (*CertificateInfo, *CertificateInfo, *CertificateInfo)

DefaultCertificates returns an initially generated CA, server, and client certificate

func RandomString

func RandomString() string

func StringPtr added in v0.5.0

func StringPtr(val string) *string

Types

type Buffer

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

func (*Buffer) Reset

func (s *Buffer) Reset()

func (*Buffer) String

func (s *Buffer) String() string

func (*Buffer) Write

func (s *Buffer) Write(p []byte) (n int, err error)

type CertificateInfo

type CertificateInfo struct {
	Cert            *x509.Certificate
	CertBytes       []byte
	PrivateKey      *rsa.PrivateKey
	PrivateKeyBytes []byte
	X509            tls.Certificate
	// contains filtered or unexported fields
}

CertificateInfo wraps all of the information needed to describe a generated certificate

var (
	DefaultTestCA                *CertificateInfo
	DefaultTestServerCertificate *CertificateInfo
	DefaultTestClientCertificate *CertificateInfo
)

func GenerateSignedCertificate

func GenerateSignedCertificate(options GenerateCertificateOptions) (*CertificateInfo, error)

GenerateSignedCertificate generates a certificate with the given options

type GenerateCertificateOptions

type GenerateCertificateOptions struct {
	CA                 *CertificateInfo
	IsCA               bool
	ServiceName        string
	SPIFFEHostOverride string
	SPIFFEPathOverride string
	ExtraSANs          []string
	ExtraIPs           []net.IP
	Expiration         time.Time
	Bits               int
}

GenerateCertificateOptions describe how he want to generate a certificate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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