mtls

package
v0.1.3-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidClientCert = errors.New("invalid certificate")

Functions

func CertInfos

func CertInfos(certPem []byte) (*certinfo.Certificate, error)

func GenerateAgentCert

func GenerateAgentCert(caFile, caKeyFile string, name, region string, expiry time.Duration, hosts []string) (certPem []byte, keyPem []byte, err error)

func GenerateCA

func GenerateCA(cn string, expiry string) (certPem []byte, keyPem []byte, err error)

func GenerateClientCert

func GenerateClientCert(caFile, caKeyFile string, name, region string, expiry time.Duration) (certPem []byte, keyPem []byte, err error)

func GenerateServerCert

func GenerateServerCert(caFile, caKeyFile string, name, region string, expiry time.Duration, hosts []string) (certPem []byte, keyPem []byte, err error)

func NewCSR

func NewCSR(name string) *csr.CertificateRequest

func RenewCA

func RenewCA(caFile, caKeyFile string) (caPem []byte, err error)

func VerifyAgentConnection

func VerifyAgentConnection(cs tls.ConnectionState) error

func VerifyServerAPIConnection

func VerifyServerAPIConnection(cs tls.ConnectionState) error

Types

type CertType

type CertType = string
const (
	AgentCert  CertType = "agent"  // for agent, used for server auth and client auth
	ServerCert CertType = "server" // for api server auth, give authority on agents
	ClientCert CertType = "client" // for client (SDK, CLI...) to talk to api server
)

Jump to

Keyboard shortcuts

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