certificates

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultValidity is 365 days
	DefaultValidity = 365 * 24 * time.Hour
)

Functions

This section is empty.

Types

type Certificates

type Certificates struct{ Webhook, Ca *KeyPair }

func Generate

func Generate(serviceName, serviceNamespace string, validity time.Duration) (*Certificates, error)

type EncodedKeyPair

type EncodedKeyPair struct{ Key, Cert []byte }

func (*EncodedKeyPair) AsMap

func (kp *EncodedKeyPair) AsMap() map[string][]byte

func (*EncodedKeyPair) SaveTo

func (kp *EncodedKeyPair) SaveTo(dir string) error

type KeyPair

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

func GenerateKeyPair

func GenerateKeyPair(config *x509.Certificate, ca *KeyPair) (*KeyPair, error)

GenerateKeyPair generates a private key and certificate for a given certificate config. If ca is nil, a new self-signed CA keypair is generated.

func (*KeyPair) Encoded

func (kp *KeyPair) Encoded() (*EncodedKeyPair, error)

Encoded returns the PEM encoded key pair

Jump to

Keyboard shortcuts

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