tls

package module
v0.0.0-...-61d51a7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

tls

This library provides helper functions to deal with TLS certificates and keys easily in Go.

License GoDoc TravisCI Codecov Go Report Card

Documentation

Please refer to the godoc pages for documentation.

Versioning

This project release version format follows Semantic Versioning.

Contributing

Pull requests and issue reports are welcomed.

License

This project is licensed under Apache License Version 2.0

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

Jump to

Keyboard shortcuts

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