cert

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CertPEM = `` /* 2117-byte string literal not displayed */
View Source
const KeyPEM = `` /* 3246-byte string literal not displayed */

Variables

View Source
var DefaultCertificate, _ = tls.X509KeyPair([]byte(CertPEM), []byte(KeyPEM))

default certificate

View Source
var DefaultMemProvider = NewMemProvider()

Functions

This section is empty.

Types

type Container

type Container interface {

	// Get the certificate for host
	Get(host string) (*tls.Certificate, error)

	// Set the certificate for host
	Set(host string, cert *tls.Certificate) error
}

certificate storage Container

type MemProvider

type MemProvider struct {
	// contains filtered or unexported fields
}

MemProvider A simple in-memory certificate cache

func NewMemProvider

func NewMemProvider() *MemProvider

Create a MemProvider

func (*MemProvider) Get

func (m *MemProvider) Get(host string) (cert *tls.Certificate, err error)

Get the certificate for the Host from the cache

func (*MemProvider) Set

func (m *MemProvider) Set(host string, cert *tls.Certificate) error

Set the Host certificate to the cache

Jump to

Keyboard shortcuts

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