utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildServerTlsConf added in v0.1.2

func BuildServerTlsConf(CAPaths []string, certPath string, keyPath string) (tlsConfig *tls.Config, err error)

BuildServerTlsConf create a tlsConfig object of type *tls.Config configured to be used in the server side. If one or more CA certificates are provided through CAPaths, mTLS configuration will be enabled and this certificates will be used to validate the client certificates.

func CreateCertFromCAFile

func CreateCertFromCAFile(caKeyPath string, caCertPath string, cn string, duration time.Duration, sansDns []string, sansIp []net.IP, dest string, certFileName string, keyFileName string) error

CreateCertFromCAFile create a new certificate and private key. That can be used at the server side for TLS server configuration and at the client side for the mTLS authentication

func LoadCertFromFile

func LoadCertFromFile(keyPath string, rsaPrivateKeyPassword string, certPath string) (certObj *types.Cert, err error)

func LoadKeyPair added in v0.1.2

func LoadKeyPair(certPath string, keyPath string, caPath string) (clientTLSConfig credentials.TransportCredentials, err error)

LoadKeyPair create a tlsConfig object of type credentials.TransportCredentials configured to be used in the gRPC client side with mTLS enabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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