certificate

package
v0.0.0-...-43c1888 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Organization = "spark-operator"
)

Variables

This section is empty.

Functions

func NewPrivateKey

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

func NewSignedServerCert

func NewSignedServerCert(cfg cert.Config, caKey *rsa.PrivateKey, caCert *x509.Certificate, serverKey *rsa.PrivateKey) (*x509.Certificate, error)

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is a container of a X509 certificate file and a corresponding key file for the webhook server, and a CA certificate file for the API server to verify the server certificate.

func NewProvider

func NewProvider(client client.Client, name, namespace string) *Provider

NewProvider creates a new Provider instance.

func (*Provider) CACert

func (cp *Provider) CACert() ([]byte, error)

CACert returns the PEM-encoded CA certificate.

func (*Provider) CAKey

func (cp *Provider) CAKey() ([]byte, error)

CAKey returns the PEM-encoded CA private key.

func (*Provider) Generate

func (cp *Provider) Generate() error

func (*Provider) ServerCert

func (cp *Provider) ServerCert() ([]byte, error)

ServerCert returns the PEM-encoded server cert.

func (*Provider) ServerKey

func (cp *Provider) ServerKey() ([]byte, error)

ServerKey returns the PEM-encoded server private key.

func (*Provider) SyncSecret

func (cp *Provider) SyncSecret(ctx context.Context, name, namespace string) error

SyncSecret syncs the secret containing the certificates to the given name and namespace.

func (*Provider) TLSConfig

func (cp *Provider) TLSConfig() (*tls.Config, error)

TLSConfig returns the TLS configuration.

func (*Provider) WriteFile

func (cp *Provider) WriteFile(path, certName, keyName string) error

WriteFile saves the certificate and key to the given path.

Jump to

Keyboard shortcuts

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