certs

package
v0.8.27 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCServerTLSCreds

func GRPCServerTLSCreds(config TLSCredsConfig) (credentials.TransportCredentials, error)

GRPCServerTLSCreds gets TLS credentials for a GRPC server

func GatewayAsClientTLSCreds

func GatewayAsClientTLSCreds(config TLSCredsConfig) (credentials.TransportCredentials, error)

GatewayAsClientTLSCreds returns transport credentials so an HTTP gateway can connect to the GRPC server

func GatewayServerTLSConfig

func GatewayServerTLSConfig(config TLSCredsConfig) (*tls.Config, error)

GatewayServerTLSConfig returns a TLS config for the gateway server

Types

type CertGenConfig

type CertGenConfig struct {
	CommonName       string
	CertKeyPath      string
	CertPath         string
	CACertPath       string
	DefaultTLSGenDir string
}

CertGenConfig contains details about how cert generation should happen

type Generator

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

Generator generates certs without any external dependencies

func NewGenerator

func NewGenerator(logger *zerolog.Logger) *Generator

NewGenerator creates a new cert generator

func (*Generator) MakeDevCert

func (c *Generator) MakeDevCert(genConfig *CertGenConfig) error

MakeDevCert creates a development certificate request and private key. It persists it in the work dir and returns the CSR.

type TLSCredsConfig

type TLSCredsConfig struct {
	TLSCertPath   string `json:"tls_cert_path"`
	TLSKeyPath    string `json:"tls_key_path"`
	TLSCACertPath string `json:"tls_ca_cert_path"`
}

TLSCredsConfig contains paths to certificates

Jump to

Keyboard shortcuts

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