Documentation ¶
Index ¶
- func BuildServerTlsConf(CAPaths []string, certPath string, keyPath string) (tlsConfig *tls.Config, err error)
- func CreateCertFromCAFile(caKeyPath string, caCertPath string, cn string, duration time.Duration, ...) error
- func LoadCertFromFile(keyPath string, rsaPrivateKeyPassword string, certPath string) (certObj *types.Cert, err error)
- func LoadKeyPair(certPath string, keyPath string, caPath string) (clientTLSConfig credentials.TransportCredentials, err error)
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 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.
Click to show internal directories.
Click to hide internal directories.