cert

package
v0.0.0-...-f6fc4ef Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 20 Imported by: 2

Documentation

Overview

Package cert fetches the root certificate for MitM proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CA

type CA struct {
	PrivateKey rsa.PrivateKey
	RootCert   x509.Certificate
	// contains filtered or unexported fields
}

func New

func New(l Loader) (*CA, error)

func (*CA) GenerateCert

func (ca *CA) GenerateCert(commonName string) (*tls.Certificate, error)

TODO: Should support multiple SubjectAltName.

func (*CA) GetCert

func (ca *CA) GetCert(commonName string) (*tls.Certificate, error)

type Getter

type Getter interface {
	GetCert(commonName string) (*tls.Certificate, error)
}

type Loader

type Loader interface {
	Load() (*rsa.PrivateKey, *x509.Certificate, error)
}

type MemoryLoader

type MemoryLoader struct{}

func (*MemoryLoader) Load

func (m *MemoryLoader) Load() (*rsa.PrivateKey, *x509.Certificate, error)

type PathLoader

type PathLoader struct {
	StorePath string
}

func NewPathLoader

func NewPathLoader(path string) (*PathLoader, error)

func (*PathLoader) Load

func (p *PathLoader) Load() (*rsa.PrivateKey, *x509.Certificate, error)

Jump to

Keyboard shortcuts

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