crypto

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultEnvoyGatewayDNSPrefix defines the default Envoy Gateway DNS prefix.
	DefaultEnvoyGatewayDNSPrefix = config.EnvoyGatewayServiceName

	// DefaultEnvoyDNSPrefix defines the default Envoy DNS prefix.
	DefaultEnvoyDNSPrefix = "*"

	// DefaultCertificateLifetime holds the default certificate lifetime (in days).
	DefaultCertificateLifetime = 365 * 5
)

Variables

This section is empty.

Functions

func LoadTLSConfig added in v1.2.0

func LoadTLSConfig(tlsCrt, tlsKey, caCrt string) (*tls.Config, error)

LoadTLSConfig returns TLSConfig form certificates.

Types

type CertProvider

type CertProvider struct {
	// Type is the type of provider to use for managing certificates.
	Type ProviderType `json:"type"`
}

CertProvider defines the provider of certificates.

type Certificates

type Certificates struct {
	CACertificate             []byte
	EnvoyGatewayCertificate   []byte
	EnvoyGatewayPrivateKey    []byte
	EnvoyCertificate          []byte
	EnvoyPrivateKey           []byte
	EnvoyRateLimitCertificate []byte
	EnvoyRateLimitPrivateKey  []byte
	OIDCHMACSecret            []byte
}

Certificates contains a set of Certificates as []byte each holding the CA Cert along with Envoy Gateway & Envoy certificates.

func GenerateCerts

func GenerateCerts(cfg *config.Server) (*Certificates, error)

GenerateCerts generates a CA Certificate along with certificates for Envoy Gateway and Envoy returning them as a *Certificates struct or error if encountered.

type Configuration

type Configuration struct {
	// Provider defines the desired cert provider and provider-specific
	// configuration.
	Provider *CertProvider
}

Configuration holds config parameters used for generating certificates.

type ProviderType

type ProviderType string

ProviderType defines the types of supported certificate providers.

const (
	// ProviderTypeEnvoyGateway defines the "EnvoyGateway" provider.
	// EnvoyGateway implements a self-signed CA and generates server
	// certs for Envoy Gateway and Envoy.
	ProviderTypeEnvoyGateway ProviderType = "EnvoyGateway"
)

Jump to

Keyboard shortcuts

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