tls

package
v1.3.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateToPem added in v1.3.0

func CertificateToPem(certificateDER []byte) []byte

CertificateToPem ...

func GenerateCACert added in v1.2.0

func GenerateCACert() (*KeyPair, *PemPair, 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 CertificateProps) string

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

func GeneratePrivateKey added in v1.3.0

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

GeneratePrivateKey Generates RSA private key

func IsTLSPairShouldBeUpdated added in v1.1.0

func IsTLSPairShouldBeUpdated(tlsPair *PemPair) bool

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

func PrivateKeyToPem added in v1.3.0

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

PrivateKeyToPem Creates PEM block from private key object

Types

type CertificateProps added in v1.3.0

type CertificateProps struct {
	Service       string
	Namespace     string
	APIServerHost string
	ServerIP      string
}

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

type KeyPair added in v1.2.0

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

KeyPair ...

type PemPair added in v1.3.0

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

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

func GenerateCertPem added in v1.2.0

func GenerateCertPem(caCert *KeyPair, props CertificateProps, serverIP string) (*PemPair, 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