certs

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCertificateHasClientAuthUsage

func AssertCertificateHasClientAuthUsage(t *testing.T, cert *x509.Certificate)

AssertCertificateHasClientAuthUsage is a utility function for kubeadm testing that asserts if a given certificate has the expected ExtKeyUsageClientAuth

func AssertCertificateHasCommonName

func AssertCertificateHasCommonName(t *testing.T, cert *x509.Certificate, commonName string)

AssertCertificateHasCommonName is a utility function for kubeadm testing that asserts if a given certificate has the expected SubjectCommonName

func AssertCertificateHasDNSNames

func AssertCertificateHasDNSNames(t *testing.T, cert *x509.Certificate, DNSNames ...string)

AssertCertificateHasDNSNames is a utility function for kubeadm testing that asserts if a given certificate has the expected DNSNames

func AssertCertificateHasIPAddresses

func AssertCertificateHasIPAddresses(t *testing.T, cert *x509.Certificate, IPAddresses ...net.IP)

AssertCertificateHasIPAddresses is a utility function for kubeadm testing that asserts if a given certificate has the expected IPAddresses

func AssertCertificateHasOrganizations

func AssertCertificateHasOrganizations(t *testing.T, cert *x509.Certificate, organizations ...string)

AssertCertificateHasOrganizations is a utility function for kubeadm testing that asserts if a given certificate has the expected Subject.Organization

func AssertCertificateHasServerAuthUsage

func AssertCertificateHasServerAuthUsage(t *testing.T, cert *x509.Certificate)

AssertCertificateHasServerAuthUsage is a utility function for kubeadm testing that asserts if a given certificate has the expected ExtKeyUsageServerAuth

func AssertCertificateIsCa

func AssertCertificateIsCa(t *testing.T, cert *x509.Certificate)

AssertCertificateIsCa is a utility function for kubeadm testing that asserts if a given certificate is a CA

func AssertCertificateIsSignedByCa

func AssertCertificateIsSignedByCa(t *testing.T, cert *x509.Certificate, signingCa *x509.Certificate)

AssertCertificateIsSignedByCa is a utility function for kubeadm testing that asserts if a given certificate is signed by the expected CA

func CreateCACert added in v1.13.0

func CreateCACert(t *testing.T) (*x509.Certificate, *rsa.PrivateKey)

CreateCACert creates a generic CA cert.

func CreateTestCert added in v1.13.0

func CreateTestCert(t *testing.T, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey)

CreateTestCert makes a generic certficate with the given CA.

func SetupCertificateAuthorithy

func SetupCertificateAuthorithy(t *testing.T) (*x509.Certificate, *rsa.PrivateKey)

SetupCertificateAuthorithy is a utility function for kubeadm testing that creates a CertificateAuthorithy cert/key pair

func WritePKIFiles added in v1.13.0

func WritePKIFiles(t *testing.T, dir string, files PKIFiles)

WritePKIFiles writes the given files out to the given directory

Types

type CertTestCase added in v1.13.0

type CertTestCase struct {
	Name        string
	Files       PKIFiles
	ExpectError bool
}

CertTestCase is a configuration of certificates and whether it's expected to work.

func GetSparseCertTestCases added in v1.13.0

func GetSparseCertTestCases(t *testing.T) []CertTestCase

GetSparseCertTestCases produces a series of cert configurations and their intended outcomes.

type PKIFiles added in v1.13.0

type PKIFiles map[string]interface{}

PKIFiles are a list of files that should be created for a test case

Jump to

Keyboard shortcuts

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