pkggithub.com/coreos/pkg/k8s-tlsutil Index | Files

package k8stlsutil

import "github.com/coreos/pkg/k8s-tlsutil"

Index

Constants

const (
	RSAKeySize   = 2048
	Duration365d = time.Hour * 24 * 365
)

Functions

func EncodeCertificatePEM

func EncodeCertificatePEM(cert *x509.Certificate) []byte

func EncodePrivateKeyPEM

func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte

func EncodePublicKeyPEM

func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error)

func NewPrivateKey

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

func NewSelfSignedCACertificate

func NewSelfSignedCACertificate(cfg CertConfig, key *rsa.PrivateKey, validDuration time.Duration) (*x509.Certificate, error)

func NewSignedCertificate

func NewSignedCertificate(cfg CertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey, validDuration time.Duration) (*x509.Certificate, error)

func ParsePEMEncodedCACert

func ParsePEMEncodedCACert(pemdata []byte) (*x509.Certificate, error)

func ParsePEMEncodedPrivateKey

func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error)

Types

type AltNames

type AltNames struct {
	DNSNames []string
	IPs      []net.IP
}

AltNames contains the domain names and IP addresses that will be added to the API Server's x509 certificate SubAltNames field. The values will be passed directly to the x509.Certificate object.

type CertConfig

type CertConfig struct {
	CommonName   string
	Organization []string
	AltNames     AltNames
}

Source Files

k8s-tlsutil.go

Version
v0.0.0-20240122114842-bbd7aa9bf6fb (latest)
Published
Jan 22, 2024
Platform
linux/amd64
Imports
10 packages
Last checked
2 weeks ago

Tools for package owners.