cert

package
v0.0.0-...-4a59956 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CA

type CA interface {
	GetRootCA() *x509.Certificate
	GetCert(commonName string) (*tls.Certificate, error)
}

func NewSelfSignCA

func NewSelfSignCA(path string) (CA, error)

NewSelfSignCA Load ca from store path or create new ca then store

func NewSelfSignCAMemory

func NewSelfSignCAMemory() (CA, error)

NewSelfSignCAMemory Create new ca only live in memory, will change when process restart

type SelfSignCA

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

func (*SelfSignCA) DummyCert

func (ca *SelfSignCA) DummyCert(commonName string) (*tls.Certificate, error)

TODO: 是否应该支持多个 SubjectAltName

func (*SelfSignCA) GetCert

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

func (*SelfSignCA) GetRootCA

func (ca *SelfSignCA) GetRootCA() *x509.Certificate

Jump to

Keyboard shortcuts

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