Documentation ¶
Overview ¶
Package tls provides helper functions to deal with certificates and keys easily.
Brief ¶
This library contains functions to make it straightforward to load certificates for TLS based servers and clients.
Usage
$ go get -u github.com/adzr/tls
Then, import the package:
import ( "github.com/adzr/tls" )
Example
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadTLSCertificate ¶
func LoadTLSCertificate(conf *Config) (cert *tls.Certificate, err error)
func LoadX509Certificates ¶
func LoadX509Certificates(path string) (certs []*x509.Certificate, err error)
Types ¶
type Config ¶
type Config struct { // Cert is the absolute path for the TLS certificate PEM file. Cert string `json:"cert,omitempty"` // Key is the absolute path for the TLS private key PEM file. Key string `json:"key,omitempty"` // PassPhrase is the pass-phrase to the private key specified in Key. PassPhrase string `json:"passPhrase,omitempty"` }
Config carries the TLS transport configuration.
func Configuration ¶
func Configuration() *Config
Click to show internal directories.
Click to hide internal directories.