tls

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCACert added in v1.2.0

func GenerateCACert() (*KeyPair, *TlsPemPair, error)

GenerateCACert creates the self-signed CA cert and private key it will be used to sign the webhook server certificate

func GenerateInClusterServiceName

func GenerateInClusterServiceName(props TlsCertificateProps) string

GenerateInClusterServiceName The generated service name should be the common name for TLS certificate

func IsTLSPairShouldBeUpdated added in v1.1.0

func IsTLSPairShouldBeUpdated(tlsPair *TlsPemPair) bool

IsTLSPairShouldBeUpdated checks if TLS pair has expited and needs to be updated

func TLSCertificateToPem added in v1.2.0

func TLSCertificateToPem(certificateDER []byte) []byte

func TLSGeneratePrivateKey added in v1.1.0

func TLSGeneratePrivateKey() (*rsa.PrivateKey, error)

TLSGeneratePrivateKey Generates RSA private key

func TLSPrivateKeyToPem added in v1.1.0

func TLSPrivateKeyToPem(rsaKey *rsa.PrivateKey) []byte

TLSPrivateKeyToPem Creates PEM block from private key object

Types

type KeyPair added in v1.2.0

type KeyPair struct {
	Cert *x509.Certificate
	Key  *rsa.PrivateKey
}

type TlsCertificateProps

type TlsCertificateProps struct {
	Service       string
	Namespace     string
	ApiServerHost string
}

TlsCertificateProps Properties of TLS certificate which should be issued for webhook server

type TlsPemPair

type TlsPemPair struct {
	Certificate []byte
	PrivateKey  []byte
}

TlsPemPair The pair of TLS certificate corresponding private key, both in PEM format

func GenerateCertPem added in v1.2.0

func GenerateCertPem(caCert *KeyPair, props TlsCertificateProps, fqdncn bool) (*TlsPemPair, error)

GenerateCertPem takes the results of GenerateCACert and uses it to create the PEM-encoded public certificate and private key, respectively

Jump to

Keyboard shortcuts

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