Documentation ¶
Index ¶
- func AppendKeyPair(tlsConfig *tls.Config, certFile string, keyFile string) error
- func AppendKeyPairWithPassword(tlsConfig *tls.Config, certFile string, keyFile string, pemPass []byte) error
- func GetPEMPassword(pemFile string) []byte
- func HasString(elem string, arr []string) bool
- func IsEncryptedPEM(pemFile string) bool
- func ListenAndServeTLS(addr string, handler nethttp.Handler, tlsConfig *tls.Config) error
- func NewTLSConfig(caFile string, mutualTLS bool) (*tls.Config, error)
- func ReadPEMData(pemFile string, pemPass []byte) ([]byte, error)
- func Verify(r *nethttp.Request, validOUs []string) error
- func VerifyOUs(validOUs []string) martini.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendKeyPair ¶
AppendKeyPair loads the given TLS key pair and appends it to tlsConfig.Certificates.
func AppendKeyPairWithPassword ¶ added in v1.4.590
func AppendKeyPairWithPassword(tlsConfig *tls.Config, certFile string, keyFile string, pemPass []byte) error
Read in a keypair where the key is password protected
func GetPEMPassword ¶ added in v1.4.590
Print a password prompt on the terminal and collect a password
func IsEncryptedPEM ¶ added in v1.4.590
Determine if PEM file is encrypted
func ListenAndServeTLS ¶
ListenAndServeTLS acts identically to http.ListenAndServeTLS, except that it expects TLS configuration. TODO: refactor so this is testable?
func NewTLSConfig ¶
NewTLSConfig returns an initialized TLS configuration suitable for client authentication. If caFile is non-empty, it will be loaded.
func ReadPEMData ¶ added in v1.4.590
Read a PEM file and ask for a password to decrypt it if needed
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.