tls

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateInClusterServiceName

func GenerateInClusterServiceName(props TlsCertificateProps) string

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

func IsTlsPairShouldBeUpdated

func IsTlsPairShouldBeUpdated(tlsPair *TlsPemPair) bool

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

func TlsCertificateGenerateRequest

func TlsCertificateGenerateRequest(privateKey *rsa.PrivateKey, props TlsCertificateProps) (*certificates.CertificateSigningRequest, error)

TlsCertificateGenerateRequest Generates raw certificate signing request

func TlsCertificateGetExpirationDate

func TlsCertificateGetExpirationDate(certData []byte) (*time.Time, error)

TlsCertificateGetExpirationDate Gets NotAfter property from raw certificate

func TlsCertificateRequestToPem

func TlsCertificateRequestToPem(csrRaw []byte) []byte

TlsCertificateRequestToPem Creates PEM block from raw certificate request

func TlsGeneratePrivateKey

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

TlsGeneratePrivateKey Generates RSA private key

func TlsPrivateKeyToPem

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

TlsPrivateKeyToPem Creates PEM block from private key object

Types

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

Jump to

Keyboard shortcuts

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