kubernetes: k8s.io/kubernetes/cmd/kubeadm/app/util/certs Index | Files

package certs

import "k8s.io/kubernetes/cmd/kubeadm/app/util/certs"

Index

Package Files

util.go

func AssertCertificateHasClientAuthUsage Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 AssertCertificateIsSignedByCa Uses

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 Uses

func CreateCACert(t *testing.T) (*x509.Certificate, crypto.Signer)

CreateCACert creates a generic CA cert.

func CreateTestCert Uses

func CreateTestCert(t *testing.T, caCert *x509.Certificate, caKey crypto.Signer, altNames certutil.AltNames) (*x509.Certificate, crypto.Signer, *certutil.Config)

CreateTestCert makes a generic certificate with the given CA and alternative names.

func SetupCertificateAuthority Uses

func SetupCertificateAuthority(t *testing.T) (*x509.Certificate, crypto.Signer)

SetupCertificateAuthority is a utility function for kubeadm testing that creates a CertificateAuthority cert/key pair

func WritePKIFiles Uses

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

WritePKIFiles writes the given files out to the given directory

type CertTestCase Uses

type CertTestCase struct {
    Name        string
    Files       PKIFiles
    ExpectError bool
}

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

func GetSparseCertTestCases Uses

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

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

type PKIFiles Uses

type PKIFiles map[string]interface{}

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

Package certs imports 9 packages (graph) and is imported by 8 packages. Updated 2019-08-27. Refresh now. Tools for package owners.