storage

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 3 Imported by: 6

Documentation

Overview

Package storage provides a TLS Store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTLSConfig

func NewTLSConfig(store Store) (*tls.Config, error)

NewTLSConfig returns a tls.Config configured to use the given Store

func SetupTLS

func SetupTLS(conf *tls.Config, store Store) error

SetupTLS configures a given tls.Config to use a given Store

Types

type RootStore

type RootStore interface {
	Store

	// AddCACert can either add a certificate chain by content, filename, or directory
	// to scan
	AddCACert(string) error

	// Prepare finishes the configuration of the store and makes sure it's in usable
	// state
	Prepare() error
}

RootStore represents a view of the Store that can be used for generic setup

type Store

type Store interface {
	GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)
	GetCAPool() *x509.CertPool
}

Store represents the most fundamental interface as needed to setup tls.Config{}

Directories

Path Synopsis
Package certpool provides a x509 Certificates store from ground up
Package certpool provides a x509 Certificates store from ground up
Package file provides a Storage implementation for storing x509 certificates as files
Package file provides a Storage implementation for storing x509 certificates as files
Package simple provides a simple self-contained TLS Store
Package simple provides a simple self-contained TLS Store

Jump to

Keyboard shortcuts

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